I have the following rewriting rules:
RewriteEngine On
RewriteBase /
RewriteCond %{THE_REQUEST} \s/+Category\.php\?Category=([^\s&]+) [NC]
RewriteRule ^ /C/%1? [R=301,L]
RewriteCond %{THE_REQUEST} \s/+product\.php\?id=([^\s&]+) [NC]
RewriteRule ^ %1? [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)?$ product.php?id=$1 [L,QSA]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^C/([^/]+)/?$ Category.php?Category=$1 [L,QSA]
the redirect work fine if you work from the home page, however when click trough to a product page on the /C/Category Name page it cannot find the product page. It is searching like so
http://localhost/C/product.php?id=302-Product-name
I presume that is because it thinks you are in a different folder. Not sure how to solve this.