开发者

redirect of a specific URL htaccess

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]
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜