Another mod_rewrite question I'm afraid! I'm trying to use mod_rewrite to enable friendly URLS... you know the score - rewriting /mydirectory/myfile/100/ to /mydirectory/myfile.php?myparameter=100 etc. I've used mod_rewrite to do this before, and don't usually have any problems. The rule I'm using is similar to this: RewriteRule ^mydirectory/([^.]+)/([0-9]+)/$ http://forums.digitalpoint.com/ [L] Now, using this rule, if the URL was mydirectory/somerubbish/1/, the rewrite works perfectly. However, if the URL is mydirectory/index/1/ - keeping in mind that I do have a file called index.php - the rewrite fails, and index.php loads instead of digitalpoint. The same applies for any string following mydirectory/, where that string is a filename. The fact that a file of that name exists (regardless of the missing extension) seems to over-ride the rewrite. What am I doing wrong?
Options +Indexes Options +FollowSymlinks RewriteEngine on RewriteBase / RewriteRule ^/mydirectory/myfile/([^.]+).html$ /mydirectory/myfile.php?myparameter=$1 [L] /mydirectory/myfile/100.html