301 redirect not working correctly with php in old URL
-
28-09-2020 - |
Question
This url
Redirect 301 /productdetail.php?pId=11390&base=1 http://domain.com/new-magento-url.html
This works
Redirect 301 /supertest http://domain.com/new-magento-url.html
I can see it is the .php but how do I except for that?
Solution
RewriteCond %{QUERY_STRING} pId=11390&base=1
RewriteRule productdetail.php http://example.com/new-magento-url.html? [R=301,L]
That should match the query string you want and perform the redirect. Place it above the last Magento rewriterule for index.php
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange