I have using Magento2.2.6 I have tried to add URL rewrites into Magento 2 using the Marketing -> Url Rewrite tool.

The old URLs for the store look like this:



I can enter that into the Request Path just fine, but anything with a ? in it never actually forwards to the Target Path. If I remove the ?, it redirects fine.. but obviously that is not a valid URL.

Any ideas or suggestions?

  • try using .htaccess file Nov 15, 2019 at 13:02
  • try: group.asp/group/320 Nov 15, 2019 at 13:05
  • @RonakChauhan I have tried this but redirect is not working.
    – Rv Singh
    Nov 15, 2019 at 13:14
  • @JimitBhavsar I have so many URL's to redirect so I can't use .htaccess need to fix by using Magento URL Rewrite Functionality.
    – Rv Singh
    Nov 15, 2019 at 13:16
  • you can override URL rewrite module and implement code in Router.php
    – Devidas
    Nov 15, 2019 at 13:48

1 Answer 1


I have found that solutions for my questions.Below define in root .htaccess file inside code use it

RewriteRule .* index.php [L]
RewriteCond %{QUERY_STRING} ^.*q=hhh.*$
RewriteRule .* /magento231? [R=301,NC,L]

RewriteCond %{QUERY_STRING} ^q=123$
RewriteRule ^(index\.php)?$ /magento231/test-category.html [QSD,R=301,L]

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.