silverstripe / silverstripe-errorpage

ErrorPage module for Silverstripe CMS
BSD 3-Clause "New" or "Revised" License
2 stars 17 forks source link

Errorpage - URLSegment Problem #74

Closed RoyalPulp closed 1 year ago

RoyalPulp commented 1 year ago

Hey :) When I open a "bad" URL like www.mydomain.com/garbagexx - the content of the 404- ErrorPage is shown (correctly) , but the URL Segment doesn't change /redirect to www.mydomain.com/not-found

For SEO, Google ... and for other technical and logical reasons - It would be best to redirect to the ErrorPage URL Is this a bug, a misconfiguration or a wanted behaviour? Thanks for any answer, Hendrik

GuySartorelli commented 1 year ago

The current behaviour is correct. The page you navigated to is not found, so you get a 404 message, but your location is still the same one you tried to access. This is the behaviour you'll find on most websites. For example: https://github.com/this-is-not-found shows you the 404 page but doesn't redirect you. not-found isn't really a page in the normal sense, it's sole purpose is to provide an easy way for content authors to decide what to show when users try to access some non-existent page.

I'm going to close this because the existing behaviour is expected and is consistent with best practices - but if you have any other questions about this feel free to ask them here.

RoyalPulp commented 1 year ago

Thank you really much for the explanation, I had to think it through with a little distance to the situation that I had yesterday - and yeah, it's totally logical now :)