I am developing a website, and I have set up the following htaccess rules
RewriteEngine On
#RewriteRule ^([0-9]+)?$ index.php?page=$1
#RewriteRule ^([0-9]+)/([0-9]+)?$ index.php?page=$1&post=$2
RewriteRule ^([A-Za-z0-9-]+)?$ index.php?pagename=$1
RewriteRule ^([A-Za-z0-9-]+)/([A-Za-z0-9-]+)?$ index.php?pagename=$1&post=$2
This ensures that instead of http://www.mysite.com/index.php?page=2
showing the page
I get to use the friendlier method of http://www.mysite.com/about-us
* note I have not included a trailing slash.
In the page my css files are included as:
<link href="css/style.css" rel="stylesheet" type="text/css" />
and located at www.mysite.com/css/style.css
And this works well, however if I want to include a trailing slash (i.e. http://www.mysite.com/about-us/
)
Then my css files do not load and I get an error where the Firefox source browser says:
The requested URL http://www.mysite.com/about-us/css/style.css
was not found on this server.
This is because the page is determining about-us to be a directory instead of a page.
I am not keen to use the basehref tag like <base href="http://www.mysite.com/" />
Are there any other options?