-
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
Fixes problem with url rewrites not being matched when the request path has a trailing forward slash #8319
Conversation
…th has a trailing forward slash. Fixes magento#8264.
@hostep Thank you for your contribution to Magento 2 project! This pull request provides fix for the issue #8264, but at the same time introduces new issue: fixed: [+] http://magento.dev/test/ --> http://magento.dev/contact/ I'd recommend trim values provided in admin UI before saving to DB (new behavior) and trim request path in URL Rewrite processor (as it is now). In this case we will align write and read flows for URL rewrites. It would be great if you can provide new Pull Request for the issue #8264. Unfortunately, we need to reject this Pull Request. Thank you for your time and contribution! |
Thanks for the review @okorshenko. If I understand you correctly, a url rewrite where the request_path doesn't end with a forward slash should always match an incoming url both with and without a trailing forward slash? Then it indeed makes sense to only save them without a forward slash in the database. Unfortunately I don't see myself having time to create a new PR for this in the near future. If anybody else wants to create a fix like what is suggested above, that would be great! |
@hostep From SEO perspective a URL with a trailing slash is completely different than a URL without a trailing slash. When URL's with or without a trailing are presenting the same page, search engines like Google can see them as duplicates. That is not what we want. Because of that behaviour of search engines, URL's should still be stored in the DB with a trailing slash if the store configuration is set to a trailing slash. |
@redelschaap: I think I agree, but it looks like the Magento folks don't agree.
I never talked about this in #8264, so you are probably talking about another issue that might be involved with this url trailing slash behavior? |
Well, then the Magento folks should reconsider their thoughts, because SEO is one of the most important parts of a great webshop these days. Yes I am, but it is indeed related. PR #7041 was originally intended as a fix for my issue where category (or product) pages would return a 404 error page when the URL suffix for categories and/or pages was set to a forward slash. See also my question on StackExchange: http://magento.stackexchange.com/questions/107477/slash-as-category-url-suffix-gives-404-error-on-all-category-pages. The solution offered in PR #7041 fixes my issue, but conflicts with this issue. Because from SEO perspective URL's with or without a trailing slash are completely different, I would not recommend to change that behaviour and let |
@redelschaap: I again agree 100%, and this PR was going to fix your issue (it is the same solution as presented in PR #7041). I'm still not sure if applying the fix presented in #7041 or in this PR won't cause any new issue, so maybe @okorshenko has a point? |
See #8264.