Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

which is better, a 404 error page or redirecting to the front page

Tags:

html

url

php

seo

I was under the impression that 404 redirects to the front page is considered bad. all websites should have a 404 page. But at the same time I notice alot of people in forums that want their site to redirect to front page when a 404 is called. which is better. Having a 404 error page or redirecting to the front page

like image 343
numerical25 Avatar asked Aug 04 '10 16:08

numerical25


People also ask

Should you redirect 404 to homepage?

404s should not be redirected globally to the home page. 404s should only be redirected to a category or parent page if that's the most relevant user experience available. It's okay to serve a 404 when the page doesn't exist anymore (crazy, I know).

What is the best method to handle 404 errors?

Redirect non-reachable pages As mentioned above, redirects are often the right solution for 404 errors on your website (see explainer). They ensure that when the URL of a page changes, the client is redirected to a new address and the content remains accessible for the user.

Why is it important to have a 404 error page?

It lets your user know that there is an error with their request. Perhaps they mistyped the URL, the page is temporarily unavailable, or the page no longer exists. An effective 404 page will recognize the mistake and guide them back to relevant pages of the site.

Do 404 errors hurt SEO?

404 error pages don't really hurt your SEO, but there's definitely a lot you can miss out if you don't fix them. If you have backlinks pointing to pages on your website that return a 404, try to fix those backlinks and 301 redirect your broken URLs to relevant location.


4 Answers

The best is a custom 404 page, totally integrated into your design / site, with perhaps some hints parsed from the url which pages might be of interest, and at least a searchform. And do let it provide a 404-header. For some reason, a lot of peope don't get that while sending a 404 you can still sent a fully fledged webpage.

like image 189
Wrikken Avatar answered Nov 15 '22 18:11

Wrikken


Definitely have a 404 page that also sends a 404 header.

  • It tells bots when URLs are outdated

  • It saves you from problems with duplicate content (that search engines frown upon)

  • It shows users when their URLs are outdated or they typed something wrongly

people want to "keep" incoming visitors by redirecting them to the front page. I'd say this creates more annoyance than good, because it doesn't give incoming users a clue about the resource they were looking for. A good 404 page, possibly with intelligent links ("were you looking for...?") and a site map, is the best option.

like image 30
Pekka Avatar answered Nov 15 '22 17:11

Pekka


This is going to be a little subjective, I'd think, but here's my opinion.

A 404 Error serves a purpose: to tell the user that the page was not found. Redirecting to the front page suggests that's where the link was supposed to go.

As a user, if I hit a 404, I know the page is missing. If its a site in which I have a vested interest (say, my bank's self-service web portal, or SO, or some such) I can let someone know there's a problem.

If, instead, I'm re-directed to the main page, I tend to assume that's done on purpose and that the page isn't meant to exist, or someone already knows about the problem.

like image 37
AllenG Avatar answered Nov 15 '22 19:11

AllenG


Minimize the 404 errors. If some resource doesn't exist anymore, use 410 Gone. A properly designed site doesn't need to take out of commission URLs. If due to errors in the past you need to, set up a redirect to the new location.

Now the only 404s that should be left are mistakes entering direct address and bad links from outside (and possibly removed resources that can't know/don't want to reveal they existed). Sending a 404 error page is better than a 30x with redirect to the homepage because:

  • It's more robot friendly. The spiders won't cache the resource thinking it's still valid.
  • You can still include a link to the homepage in the 404 error page (in fact, you should).
like image 26
Artefacto Avatar answered Nov 15 '22 19:11

Artefacto