4

I am migrating a store from an old custom commerce system to Magento 2. I am trying to add URL rewrites into Magento 2 using the Marketing -> Url Rewrite tool.

The old URLs for the store look like this:

store/detail/x.php?id=123

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?

2 Answers 2

5

Magento 2 reads parameters in the following format: somepage/param/param_value/

It ignores the question mark. In your situation you have 2 options to go:

1) Manage this by using the rewrite rules of the webserver.

For more information on this, please check:

2) Write your custom router for processing URLs

Please see my example on how to do this there: Configure front name in admin panel

1
  • I was trying to avoid this route, but it looks easier to put them in nginx than it does to create a new url processor.
    – Adam R.
    Commented Oct 16, 2018 at 16:48
0

You can create a module which works the same as a htaccess rewrite rule. After two days trying to get htaccess rewrite to work I found this works perfectly for Magento 2.4: https://magento.stackexchange.com/a/158811/109113

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.