I have a mod_rewrite rule working to direct non-existing directories to a php file which does a database get based on the $1.
Everything works fine unless the directory does exist, which displays the proper directory, but it also appends the query string when it's not necessary.
I have been scouring the web for the past few hours and trying different methods with no luck.
Does anyone know how to keep this functioning as-is, but get rid of the query string?
Thanks much.
Here is my code:
RewriteEngine On
Options +FollowSymlinks
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([0-9a-zA-Z\-]+)/$ $1 [R]
RewriteRule ^([0-9a-zA-Z\-]+)$ product.php?product=$1
What ends up happening is the browser displays the URL as http://domain.com/existing_dir/?product=existing_dir