I tried to apply the solution in this answer to redirecting problem. Doesn't seem to work. I'm stumped.
I need to redirect (domain.com/shop/cart.php?m=product_detail&p=7) to (domain.com/shop/category-page/product-page-c23/).
The code I tried is below:
RewriteEngine On
Rewrite开发者_StackOverflow社区Cond %{QUERY_STRING} (^|&)m=product_detail(&|$)
RewriteCond %{QUERY_STRING} !(^|&)p=7
RewriteRule cart.php /shop/category-page/product-page-c23/
I really appreciate any advice that is out there. Thank you. I'll buy you a beer.
There are some minor mistakes in your code. Try this code in .htaccess:
Options -MultiViews +FollowSymLinks
RewriteEngine On
RewriteCond %{QUERY_STRING} (^|&)m=product_detail(&|$) [NC]
RewriteCond %{QUERY_STRING} (^|&)p=7(&|$) [NC]
RewriteRule ^shop/cart\.php/?$ /shop/category-page/product-page-c23/ [NC,L]
精彩评论