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?

asked Oct 15, 2018 at 18:28

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

answered Oct 15, 2018 at 22:27
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. 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

answered Jan 17, 2023 at 10:54

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.