Credit Cards UK - Refinance - Loans - Online Loans - Mortgages

PDA

View Full Version : mod rewrite conflicts with real folder


mad4
Apr 18th 2006, 6:15 am
I rewrite domain.com/product/ to domain.com/page.php3?id=product using the following htaccess

RewriteRule ^(.*)/$ /page.php3?id=$1

The problem is that I have a stats directory at domain.com/stats which is redwritten with this script as well.

How can I solve this?

Nintendo
Apr 18th 2006, 2:44 pm
Options +Indexes
Options +FollowSymlinks
RewriteEngine on
RewriteBase /
RewriteRule ^(.*)/$ page.php3?id=$1
RewriteRule ^stats/$ stats/ [L]

If that doesn't fix it, the only way is having something uniqe in the fake URLs, like adding a directory, or extention.

mad4
Apr 18th 2006, 4:04 pm
I had already tried that but it failed. Over the last hour I fixed it using the following code.......
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [L]
RewriteRule ^(.*)/$ /page.php3?id=$1

This checks to see if there is a real directory before it applies the rewrite rule.:)