0

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:

group.asp?group=320

http://XXXXXXX/magento231/catalogsearch/result/?q=test

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?

6
  • try using .htaccess file Commented Nov 15, 2019 at 13:02
  • try: group.asp/group/320 Commented Nov 15, 2019 at 13:05
  • @RonakChauhan I have tried this but redirect is not working.
    – Rv Singh
    Commented 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
    Commented Nov 15, 2019 at 13:16
  • you can override URL rewrite module and implement code in Router.php
    – Devidas
    Commented Nov 15, 2019 at 13:48

1 Answer 1

0

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.