Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

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

Closed
wants to merge 3 commits into from

Conversation

tobymackenzie
Copy link

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.

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.
@xabbuh
Copy link
Member

xabbuh commented May 21, 2016

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?

@tobymackenzie
Copy link
Author

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.

Copy link
Member

@javiereguiluz javiereguiluz left a 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.

@tobymackenzie
Copy link
Author

Made some changes. Let me know if the comment is too long. I'm not great with brevity.

@weaverryan
Copy link
Member

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 /foo/ and we 301 redirect to /foo (which is a 404). But, how did Google know to go to /foo/ in the first place? There must be a link to this page, right? In that case, we really do have a broken link somewhere, a link to /foo/?

@tobymackenzie do I misunderstand the situation? Let me know :).

@tobymackenzie
Copy link
Author

That's basically correct. However, two circumstances complicate that:

  • External links to your site pointing there. You don't really have control over this.
  • You once had a page with trailing slash already indexed by Google. This could be because of a different architecture for the previous version of your site or whatever. Google remembers this even though no pages still have that link. Google goes there, sees the 301, follows it, and assumes there should be something there. Now, because there is a "link" to the page and whatever magic a 301 gives it, it seems to stay forever.

@javiereguiluz
Copy link
Member

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.