-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Remove trailing slash: check for match #6317
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
Conversation
A 301 seems to imply that the redirect target exists. Redirecting to a 404 page is all the same to a normal end user, but it seems Google will see it as a crawl error. This change just makes sure that there is a route that will match the redirected URL; otherwise a 404 is thrown.
Could we maybe think about changing this to an event listener instead that would only be executed when there actually is a controller for the URL being accessed? |
Is this for performance reasons? I'm not sure I know how to go about implementing that. Regardless, it is possible to create routes without controllers, for the case when another application is fielding those routes and you just want to have them in this application for generating URL's. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd fix a bit the code syntax (some spaces are missing) and I'd also add a short comment before the new code to explain why it's needed.
Made some changes. Let me know if the comment is too long. I'm not great with brevity. |
I'm 👎 on this right now. It's a really interesting situation: if you 301 redirect to a 404, Google sees that as a broken link. But, in order for this to happen, Google must already be following a link to get to this controller in the first place. Said differently, the problem described here is that Google goes to @tobymackenzie do I misunderstand the situation? Let me know :). |
That's basically correct. However, two circumstances complicate that:
|
I'm closing this because there's no consensus around it and it has some downvotes for Docs Core team. @tobymackenzie I'm sorry, but rest assured that we'll reconsider this decision if we receive more reports about this in the future. Thanks! |
A 301 seems to imply that the redirect target exists. Redirecting to a 404 page is all the same to a normal end user, but it seems Google will see it as a crawl error. This change just makes sure that there is a route that will match the redirected URL; otherwise a 404 is thrown.