-
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
[2.1-backport] Fix trailing slash used in url rewrites #10164
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(cherry picked from commit c4b5874)
(cherry picked from commit 0ee7c9c)
If request path doesn't match the DB values, if it's redirect (301 or 302) - follow redirect rules from DB results (to have only one redirect); if it's not redirect (category or product page) - redirect to request_path from DB. It will reduce negative effect for SEO and a little bit server load (1 request instead of 2). (cherry picked from commit bddb74c)
Use ternary operators instead of if-else blocks (cherry picked from commit 30c2c79)
Cover with unit tests (cherry picked from commit fe77c14)
Cover with unit tests (cherry picked from commit ac41ad0)
- covered changes with integration tests (cherry picked from commit 0ecf635)
- fixed integration tests (cherry picked from commit 82e5ebe)
- added integration tests for CMS pages (cherry picked from commit 8f031d0)
…agento#10164 - fixed unit tests failures
…agento#10164 - fixed static tests failures
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
My pull request #10043 has been merged to develop branch. This PR adds the same changes to 2.1-develop branch
Description
Admin user configured two URL rewrites in Admin UI. Frontend user may request the page with or without trailing slash. In some case Magento will return 404 page.
We would like to avoid content duplication for the requests with and without trailing slash. If request path has configured url_rewrite (w/ or w/o trailing slash) redirect to this page automatically. If requested path matches configuration, just follow redirect rules.
Fixed Issues (if relevant)
Related pull requests
Contribution checklist