2

Suppose user hits a dead link /foo. I have two options.

  1. I can respond with the 404 HTTP status, X-Robots-Tag: noindex and display a custom error message to the user.
  2. Or, I can redirect user with HTTP status 301 to an /error page that server the 404 message (with the 404 HTTP status and the X-Robots-Tag: noindex header).

What is the preferred user flow?

3 Answers 3

5

Note that the robot tag is redundant; search engines already avoid indexing 404 pages.

You should pick choice 1. Choice 2 has the following disadvantages:
1. Can interfere with a user's browser history (using the back button, etc.).
2. Makes it more difficult to correct the URL, if the user mistyped it by hand.
3. If your error page ever breaks, you will cause an infinite redirect.

3

The option 1, definitely.

The option 2 is wrong.

  1. It adds a useless step.
  2. The HTTP 301 status code means “Resource moved permanently”. How could you say the resource has moved, when there is no resource found at all ?
  3. Worse, it means : “There is nothing, and there will never be anything, at the address "/foo".” Whereas you just want to say : “There is nothing right now at the address "/foo".” Tomorrow, or even in 2 minutes, there may be something.
  4. You lose the info of what was requested. The user gets : “The stuff is not found.” But what stuff ?? S/he does not know. It is much more informative to say : “The stuff "/foo" is not found.”
2

An SEO professional by trade, I meticulously hunt down and eliminate all 404s with a prejudice! Bad for UX, horrible for rankings!

It's easy to find 404'd pages with Link Slueth, Screaming Frog, or Google Webmaster Tools and 301 them to similar pages.

However their do come those times when there are no similar pages to 301 a 404'd page to. In that case I like to have a 404 page that allows the user to:

  • Search the site
  • Navigate back to the home page
  • Browse main site categories
  • List related/similar material that may help answer their question

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.