-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Fix removing query string from url after redirect #25603
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
Fix removing query string from url after redirect #25603
Conversation
add ability to save query param from request during redirect to target path
update unit test
Hi @arendarenko. Thank you for your contribution
For more details, please, review the Magento Contributor Guide documentation. |
9b62325
to
29c8dd7
Compare
Hello there Previously fix related to this issue has been reverted by internal Magento team. |
Moved to "on hold", waiting for discussion with Architects |
dev/tests/integration/testsuite/Magento/UrlRewrite/_files/url_rewrite.php
Show resolved
Hide resolved
dev/tests/integration/testsuite/Magento/UrlRewrite/Controller/UrlRewriteTest.php
Outdated
Show resolved
Hide resolved
29c8dd7
to
907cb89
Compare
update fixture update integration test
907cb89
to
f63475c
Compare
Hi @lbajsarowicz, thank you for the review.
|
Hi @lbajsarowicz, |
I double checked this PR after discussion with @akaplya (details here #18717 (comment)) - changes looks good. Also I covered cases when target URL is external URL (not magento) with integration test, in this case GET params that came to magento should not be added to redirect URL. Now this solution should works fine. Let's wait once all tests will be passing and then I'll approve this PR. |
Cover with integration tests cases with external URLs as target path
e9514f7
to
b1a2a29
Compare
Hi @Zyles, |
Magento 2.3.3 Nginx config:
|
@magento give me test instance |
Hi @ihor-sviziev. Thank you for your request. I'm working on Magento instance for you |
@Zyles ok, you provieded your environment configuration, but not steps to reproduce. Actually I tried it on my own environment - everything works fine. Please add more details, which URL rewrite do you have in the magento, which request you're doing, what are expected and actual result? Also would be great in order to prevent any caching issues to send request via |
@magento give me test instance |
Hi @sdzhepa. Thank you for your request. I'm working on Magento instance for you |
Hi @sdzhepa, here is your new Magento instance. |
Go to a category. Click paginate to page 2. 301 redirect to page 1. /category/?p=2 -> /category/ Or type in the URL manually. |
|
With SEO settings category suffix blank. No "/". Creates duplicate content:
|
Thx, will double check it little bit later, but definitely this is not
expected result
…On Tue, 17 Dec 2019 at 17:41, Zyles ***@***.***> wrote:
With SEO settings category suffix blank. No "/".
Creates duplicate content:
$ curl -I https://store.magento/category/?p=2
HTTP/2 <https://store.magento/category/?p=2HTTP/2> 200
server: nginx
date: Tue, 17 Dec 2019 15:38:11 GMT
content-type: text/html; charset=UTF-8
content-length: 363506
vary: Accept-Encoding
set-cookie: PHPSESSID=177nksbcr7e1jqf80ni3js7fkh; expires=Fri, 17-Jan-2020 01:38:11 GMT; Max-Age=2628000; path=/; domain=store.magento; secure; HttpOnly
pragma: no-cache
cache-control: max-age=0, must-revalidate, no-cache, no-store
expires: Mon, 17 Dec 2018 15:37:40 GMT
strict-transport-security: max-age=31536000
content-security-policy: upgrade-insecure-requests;
x-content-type-options: nosniff
x-xss-protection: 1; mode=block
x-frame-options: SAMEORIGIN
$ curl -I https://store.magento/category?p=2
HTTP/2 <https://store.magento/category?p=2HTTP/2> 200
server: nginx
date: Tue, 17 Dec 2019 15:39:23 GMT
content-type: text/html; charset=UTF-8
content-length: 364548
vary: Accept-Encoding
pragma: no-cache
cache-control: max-age=0, must-revalidate, no-cache, no-store
expires: Mon, 17 Dec 2018 15:39:23 GMT
strict-transport-security: max-age=31536000
content-security-policy: upgrade-insecure-requests;
x-content-type-options: nosniff
x-xss-protection: 1; mode=block
x-frame-options: SAMEORIGIN
/category/?p=2 is not the same as /category?p=2
https://searchfacts.com/url-trailing-slash/
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#25603?email_source=notifications&email_token=AAOJOUPDVQYTZH5GBNXBGYLQZDXJBA5CNFSM4JNLLX2KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHCZHAQ#issuecomment-566596482>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAOJOUNARWNS36XGDE34QCDQZDXJBANCNFSM4JNLLX2A>
.
|
@Zyles i just checked on test instance and wasn’t able to reproduce it, so I think it’s web server configuration issue. https://pr-25603.instances.magento-community.engineering/category-1/?p=2 Just checked your nginx configuration and found following line:
I believe the / near the |
Same problem. |
Does this demo have the pull request patch installed? Can you populate the demo with sample products? |
@magento-engcom-team give me 2.3.3 instance |
Hi @Zyles. Thank you for your request. I'm working on Magento 2.3.3 instance for you |
Hi @Zyles, here is your Magento instance. |
https://i-25603-2-3-3.instances.magento-community.engineering/category/?p=2 Is it possible to apply pull request on this instance? |
It is already contains changes from this PR
…On Tue, 17 Dec 2019 at 19:22, Zyles ***@***.***> wrote:
https://i-25603-2-3-3.instances.magento-community.engineering/category/?p=2
Is it possible to apply pull request on this instance?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#25603?email_source=notifications&email_token=AAOJOUJK2ULIRE77GSKPRIDQZEDG7A5CNFSM4JNLLX2KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHDJN6I#issuecomment-566662905>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAOJOUKV7PC7JGNVK3F57DTQZEDG7ANCNFSM4JNLLX2A>
.
|
Ah, no. We can request changes for this PR + changes from 2.4-develop, or changes from 2.3.3 BTW I added small performance profile to following instance, so there enough products |
Reproduced ERR_TOO_MANY_REDIRECTS on local fresh install 2.3.3 with patched file:
Please try 2.3.3. We can't upgrade to 2.4-develop on live website. |
Yeah, I finally found it. So in order to have correct fix for 2.3.3 - before you need to apply following commit fa468e7 (reverts changes that were added to 2.3.3) and only then apply changes from this PR. So changes from this PR should works fine. Could you confirm that? |
Thank you, seems to work now. |
Hi @arendarenko, thank you for your contribution! |
Description (*)
See #18717 (comment)
Fixed Issues (if relevant)
Manual testing scenarios (*)
See #18717 (comment)
Questions or comments
Contribution checklist (*)