Forum Moderators: phranque
I have just finished setting up my .htaccess mod_rewrite which is working fine.
My .htaccess/mod_rewrite working:
www.domain.com/article.php?title=atitle
>
www.domain.com/$category/$title.
My problem is, that everything typed after www.domain.com/ (www.domain.com/everything/) calls up the article.php page.
Here is the part of mod_rewrite code from my .htaccess
RewriteRule ^([^/\.]+)/?$ /article.php?animal=$1 [L]
RewriteRule ^([^/\.]+)/([^/\.]+)/?$ /article.php?atype=$1&animal=$2 [L]
Any ideas to stop this on specific directories i.e /www.domain.com/images/
If so, modify your RewriteRule patterns to require them.
If not, you can add an exclusion to each rule:
RewriteCond %{REQUEST_URI} !^/images/
However, I'd also suggest you add exclusions for robots.txt, /w3c/p3p.xml, labels.rdf or labels.xml, any any custom error pages, shared headers or footers, or shared client-side scripts you may have.
Note that a RewriteCond applies only to the first RewriteRule that follows it. You will ned the same exclusion for each rule. If the list of exclusions gets too long, you can re-arrange the code to avoid this duplication, but that's another subject.
Jim