clean urls problem and solution - mod_rewrite
Posted: Mon May 08, 2006 5:31 pm
I followed a forum post (can't remember where it was) that instructed me to copy the htaccess.txt from the doc directory to the root directory of cmsms, then to turn on the "assume clean urls" flag in the config file.
I did these 2 things, but couldn't get it to work.
After making sure mod_rewrite was working on my server, I started looking at the rewrite rules.
Seems that the version in the doc directory has this:
RewriteRule ^(.+)\.html$ index.php?page=$1 [QSA]
however the "assume clean urls" creates urls for the menu items without the .html extension, so going to the homepage of the site, then trying to navigate using the menus fails to work.
I added .html to the url and it worked.
Then modified the rewrite rule to drop the .html extension:
RewriteRule ^(.+)$ index.php?page=$1 [QSA]
and it worked completely.
Maybe I'm missing something, but if I'm not missing something, then the example htaccess.txt in the doc directory should be fixed to not use the .html extension in the rule.
Thanks!
Wes
I did these 2 things, but couldn't get it to work.
After making sure mod_rewrite was working on my server, I started looking at the rewrite rules.
Seems that the version in the doc directory has this:
RewriteRule ^(.+)\.html$ index.php?page=$1 [QSA]
however the "assume clean urls" creates urls for the menu items without the .html extension, so going to the homepage of the site, then trying to navigate using the menus fails to work.
I added .html to the url and it worked.
Then modified the rewrite rule to drop the .html extension:
RewriteRule ^(.+)$ index.php?page=$1 [QSA]
and it worked completely.
Maybe I'm missing something, but if I'm not missing something, then the example htaccess.txt in the doc directory should be fixed to not use the .html extension in the rule.
Thanks!
Wes