I have been using simple mod_rewrite rules for my CMS for many years, and now I am making a new version, I see that rewriteCond does not make sense - I have the standard "if it is not a file", but I can still see that the rewriters though and were not expected. My rewrite code:
RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^([^/]+)$ index.php?page=$1 RewriteRule ^([^/]+)/([^/]+)$ index.php?page=$1&var=$2
I load / page / var and it works fine like index.php? page = page & var = var, but am I trying to load /css/file.css and loading index.php? page = css & var = file.css, although there is a /css/file.css file, so the entire rewrite section should not be evaluated.
I have never seen htaccess seem to be challenging its own logic, can someone help me figure this out? Has anyone ever come across anything like this?
.htaccess mod-rewrite
Colin Mar 30 '09 at 16:21 2009-03-30 16:21
source share