This is my htaccess file
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php #Line 1
RewriteRule ^([a-zA-Z0-9_-]+)$ product.php?name=$1 #Line 2
RewriteRule ^([a-zA-Z0-9_-]+)/$ product.php?name=$1 #Line 3
Line 1 is to remove php extension for all files
Line 2 and 3 are such that if you type website.com/ it will translate into website.com/product.php?name=something
Now, I installed a blog whose url is website.com/blog
This is interfering with the product. So instead of serving website.com/blog it gets translated to website.com/product.php?name=blog which is giving incorrect results. How can this problem be solved.
You may find this question useful: Redirect requests only if the file is not found?
The following may also be of interest: How do I ignore a directory in mod_rewrite?
Try putting this before any other rules.