-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed #18717 UrlRewrite removes query string from url, if url has trailing slash #20901
Conversation
Hi @shikhamis11. Thank you for your contribution
For more details, please, review the Magento Contributor Assistant documentation |
#MM19IN |
Looks like it's related to my very old fix of #10043 |
Hi @shikhamis11, Ah, I understood, you will not have 301 redirect in case your request was /some-url-key/?a=b, but in URL rewrites table - /some-url-key, it causes regression and that's why unit tests are failing. I think we should discuss expected behavior with @akaplya, he's assigned to Url Rewrites module. After #10043 we have following actual & expected results without get parameters:
I think for URLs with get parameters we should the same behavior.
|
hello @ihor-sviziev . Thank you for your comments . As I can see in the code the request path is being matched with results in the database so for avoiding mismatch due to trailing slash we can trim the slash from results and compare it |
Hi @shikhamis11, I'm trying to contact to Magento Architects to define what is expected result. Until that time - no action items. |
ok thanks |
Hi @shikhamis11. Thank for collaboration. I discused this case with architect that is responsible for UrlRewrite module and with product owner of this area and we took decision that the proposal provided by @ihor-sviziev above is correct. So, please update your fix according to rules described above. |
@shikhamis11 , I am closing this PR now due to inactivity. |
Hi @shikhamis11, thank you for your contribution! |
Fixed #18717 UrlRewrite removes query string from url, if url has trailing slash
Preconditions (*)
When customer opens url with trailing slash and query string like http://magento-host.com/some-url-key/?foo=bar, Magento redirects to url without trailing slash and truncates query string, so customer is redirected to http://magento-host.com/some-url-key.
Steps to reproduce (*)
/?foo=bar&bar=baz
to the url and open this linkExpected result (*)
Actual result (*)
Additional information
We are looking for both urls (with trailing slash and without it), but when verifying the result from database we do not check it.
Contribution checklist (*)