I have a strange problem with mod_rewrite condition / rule.
This is the condition and rule that I use.
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.*)$ index.php?params=$1 [QSA,L]
My problem is that if I visit www.example.com and www.example.com/page, it loads normally, but when I try to download www.example.com/page/category it loads the page, but cannot find css and javascript. He tries to load them from the / css page instead of the / directory.
Any thoughts on what I did wrong? I had a search here and tried a few things, for example, add
RewriteCond $1 !\.(js|ico|gif|jpg|png|css|html|swf|mp3|wav|txt)$
and
RewriteRule ^(images|css|javascript)(.*)$ index.php?params=$1 [QSA,L]
But that didn't seem to make much difference.
Thanks for reading
source
share