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
Content detailed page throwing 404 when URL contains a trailing slash. #23276
Comments
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This Rule may suffice in many cases to preserve the trailing slash behavior of URL mapped content after an upgrade. It obviously could be onerous if too many paths need to be matched. It provides a 301 HTTP redirect from Googlebot and friends respect 301 redirects so this will preserve SEO for any old URLs with trailing slashes that may be out in the wild. |
Another ticket https://dotcms.zendesk.com/agent/tickets/111098 |
* Avoid the clash between IndexPages and UrlMaps cases.
* We created a IAm subtype enum to manage different page types instead of creating a new IAm type. * We use tuples to manage isPageAsset and resourceResolveType methods.
* New method has been created in order to avoid changes on third classes.
* Avoid the clash between IndexPages and UrlMaps cases. * We created a IAm subtype enum to manage different page types instead of creating a new IAm type. * We use tuples to manage isPageAsset and resourceResolveType methods. * resolvePageAssetSubtype method has been created in order to avoid changes on third classes that use isPageAsset method.
* Replacing new Tuple2<> constructor statements by Tuple.of() method. * Replacing condition NOT isPresent() by isEmpty method
* resolveResourceType method * resolvePageAssetSubType method
Another ticket: https://dotcms.zendesk.com/agent/tickets/110282 |
* #23276 IAm subtypes have been included. * Avoid the clash between IndexPages and UrlMaps cases. * We created a IAm subtype enum to manage different page types instead of creating a new IAm type. * We use tuples to manage isPageAsset and resourceResolveType methods. * resolvePageAssetSubtype method has been created in order to avoid changes on third classes that use isPageAsset method. * #23276 Some improvements. * Replacing new Tuple2<> constructor statements by Tuple.of() method. * Replacing condition NOT isPresent() by isEmpty method * #23276 Refactoring resolvePageAssetSubtype * #23276 Some test have been added to CMSUrlUtil * resolveResourceType method * resolvePageAssetSubType method * #23276 Test documentation has been added. * #23276 Some unuseful code has been removed. * #23276 Some unuseful code has been removed. --------- Co-authored-by: daniel.colina <daniel.colina@dotcms.com> Co-authored-by: Nollymar Longa <nollymar.longa@dotcms.com>
* #23276 IAm subtypes have been included. * Avoid the clash between IndexPages and UrlMaps cases. * We created a IAm subtype enum to manage different page types instead of creating a new IAm type. * We use tuples to manage isPageAsset and resourceResolveType methods. * resolvePageAssetSubtype method has been created in order to avoid changes on third classes that use isPageAsset method. * #23276 Some improvements. * Replacing new Tuple2<> constructor statements by Tuple.of() method. * Replacing condition NOT isPresent() by isEmpty method * #23276 Refactoring resolvePageAssetSubtype * #23276 Some test have been added to CMSUrlUtil * resolveResourceType method * resolvePageAssetSubType method * #23276 Test documentation has been added. * #23276 Some unuseful code has been removed. * #23276 Some unuseful code has been removed. --------- Co-authored-by: daniel.colina <daniel.colina@dotcms.com> Co-authored-by: Nollymar Longa <nollymar.longa@dotcms.com>
* #23276 IAm subtypes have been included. * Avoid the clash between IndexPages and UrlMaps cases. * We created a IAm subtype enum to manage different page types instead of creating a new IAm type. * We use tuples to manage isPageAsset and resourceResolveType methods. * resolvePageAssetSubtype method has been created in order to avoid changes on third classes that use isPageAsset method. * #23276 Some improvements. * Replacing new Tuple2<> constructor statements by Tuple.of() method. * Replacing condition NOT isPresent() by isEmpty method * #23276 Refactoring resolvePageAssetSubtype * #23276 Some test have been added to CMSUrlUtil * resolveResourceType method * resolvePageAssetSubType method * #23276 Test documentation has been added. * #23276 Some unuseful code has been removed. * #23276 Some unuseful code has been removed. --------- Co-authored-by: daniel.colina <daniel.colina@dotcms.com> Co-authored-by: Nollymar Longa <nollymar.longa@dotcms.com>
Nice! I saw this as an issue on our site while doing a crawl. (= Yeah Google doesn't care if you have a / or not at the end of a URL. So we should just ignore that. Doesn't matter if you have a / or not in the canonical URL either -- except to say that sometimes you have to write another bit of regex to get the crawls to line up if you have different canonical URLs -- so ideally we would just load the same consistent / or no / for canonical URLs between the pages. We don't really need to 301 one to the other... Google views them both as the same URL. And... since it views the URL as the same, adding a 301 redirect can muddy things (A 301 from one identical page to the other can inflate the "hops" if we have any other redirects present.) So I think ideally they would both just load as a 200... But let me know when this is released on our demo site and I'll run some further scans to verify. @nollymar I just closed #25264 as a dupe of this. |
Yeah OK, so doing another test... It's really not good to 404 on the / since if we have any links that have a / that Google finds... it'll record the 404 as being on the page -- it doesn't care if there is a / or no slash, it sees the URLs as identical. https://demo.dotcms.com/store/products/k2-mens-mindbender-99ti-skis But also, 301 from / to no slash seems OK... as long as there are no other 301s ahead in the "chain" and as long as the final version of the page shows a 200. But yeah, I think ideally... both should just give a 200. No redirect needed. As long as the Canonical URLs are identical (but again, that's just to be kind to people doing crawls so they don't have to write any regex to sort out the different URLs). |
@damen-dotcms both urls give a 200 code, but this change is not yet released. It will be for the next release. Internal QA: passed Tested on master. |
Approved QA - Tested on master_b295876_SNAPSHOT // Docker // macOS 13.0 // FF v113.0 |
Describe the bug
Content detailed page throwing 404 when URL contains a trailing slash.
Reproduced on 22.10
Related ticket: https://dotcms.zendesk.com/agent/tickets/108893
To Reproduce
https://demo.dotcms.com/store/products/k2-mens-mindbender-99ti-skis Works fine
https://demo.dotcms.com/store/products/k2-mens-mindbender-99ti-skis/ throws 404
Expected behavior
The detailed page should return the desired contentlet when a trailing slash exists
Additional context
This behavior works fine on 21.06., 5.3.8.
The text was updated successfully, but these errors were encountered: