I'm using mod_rewrite to change all the URLs on a site. Example: http://www.site.com/about/
becomes http://www.site.com/?action=about
(don't worry, I have nice friendly sanity checking). The problem is that for anything other than http://www.site.com/
the CSS stylesheet won't load. I assume this is because it looks for the stylesheet in /about/content/style.css
instead of /content/style.css
. How do I make sure it finds the right stylesheet?
Here's some of my code just in case. .htaccess
looks like this:
RewriteEngine on
RewriteRule ^news/([0-9]+)/?$ /?action=news&start=$1 [L]
RewriteRule ^news/?$ /?action=news&start=0 [L]
RewriteRule ^(about|contact|man|home|download)/?$ /?action=$1 [L]
They all redirect to index.php
, which starts off like this:
<html>
<head>
...
<link rel="stylesheet" href="content/style.css" type="text/css" />
</head>
<body>
...
</body>
</html>