[Webinar] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 220
  • Last Modified:

return a 301 for a 404?

Typically in the past, I've returned a status code 404 for page not found errors using IIS and a custom 404 error page. However, another option being suggested by a fellow team member is to return a 301 instead of a 404. I've not done it this way before and wanted to get some feedback and suggestions on how to do it this way? The thought behind the 301 is to do a permanent redirect to the home page.
4 Solutions
Dave BaldwinFixer of ProblemsCommented:
If it makes any difference to you, Google doesn't want you to do that because it is misleading.  It would indicate that a page is there when it isn't.  You can instead do a 'meta' refresh back to your home page on your custom error page.

Kyle AbrahamsSenior .Net DeveloperCommented:
You use a 301 when renaming pages or domains, with no intention of coming back.  So if the page existed before and it will never exist again a 301 is a valid option.  If the user just mistypes the page though it should return a 404.
Neil RussellTechnical Development LeadCommented:
I would never consider such a thing! Would never advise such a thing and would go as far as to say Don't do it!

HTTP Protocol error numbers exist for a reason.  a 301 is a perm redirect. Search engines will see this as "The page exists but its moved, its now at......" and go to your home page, indexing it again and quietly noting that it is visiting this page an awful lot, seeing it as an attempt to "FIX" SEO.

Use a standard custom 404 page that includes a LINK to your home page.
There is nothing that stops you from doing a redirect, I just think that you want to be able to actually know if content has moved or been deleted.

I suggest sticking with your custom 404 (This helps to identify issues of missing content)

Imagine if someone deleted a file accidentally, users would never know anything was broken because they would just keep going back to the home page.

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now