Reputation: 437
This is my code in .htaccess
RewriteEngine On
RewriteRule ^explore/([0-9a-zA-Z\ ]+)/([0-9a-zA-Z]+)/([0-9a-zA-Z]+) renderpage.php?menu=$1&submenu=$2&subsubmenu=$3 [NC]
and when I type www.mysite.com/explore/Servizi%20ADR/Mediazione/Regolamento (excuse the italian)
"explore/Servizi%20ADR/Mediazione/Regolamento/jquery.js "
So my guess is I have to write something like a RewriteCond, but I don't know what exactly
Upvotes: 1
Views: 19
Reputation: 24468
You should use conditions to not include real files or dirs. And also use a base path for files like this
RewriteEngine On
#if requested URI is real file or dir, do nothing
RewriteCond %{REQUEST_FILENAME} -d [OR]
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^ - [L]
#else process the rule
RewriteRule ^explore/([0-9a-zA-Z\ ]+)/([0-9a-zA-Z]+)/([0-9a-zA-Z]+)/? renderpage.php?menu=$1&submenu=$2&subsubmenu=$3 [NC,L]
Also you can put the base tag in the head section of your html, instead of using absolute paths for your js and css.
<base href="http://www.yoursite.com" />
Upvotes: 1