Forum Moderators: Robert Charlton & goodroi

Message Too Old, No Replies

Redirects or 404's for non-existent pages

which is correct?

         

dmje

9:11 am on Feb 8, 2006 (gmt 0)

10+ Year Member



On our site we have removed many pages in a reorganization of the site....I have set those removed pages to be redirected to either the index page or a page similar in content to the page that was removed.

Which would have been better, from a search engine perspective, a 404 or 410 for the pages that are gone and will not be back or the redirect to a similar page?

My thoughts at the time were, the redirect, so that our customers would at least hit a similar page on our site instead of just encontering a 404 error and never reaching our site when coming in from the search engine.

fourchette

12:17 pm on Feb 8, 2006 (gmt 0)

10+ Year Member



From our experience, you should never redirect deleted pages to the index page as it is possible that the search engines will crawl the old URL and the index page many times...

This will lead to... yes, duplicate content, it's logic after all.

The best way to go would be to put a 404 or 410 with some kind of site map on it, where you can point the users to the home page or other pages of interest.

fourchette

minnapple

1:39 am on Feb 9, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You might want to check out Matt Cutts blog [mattcutts.com...] for how google is viewing 404's and 410's.
From what I get out of it Google see's 404's as 410's.
This is a little disturbing, if your site goes down for any reason you could be in deep do do.

Miop

2:51 am on Feb 9, 2006 (gmt 0)

10+ Year Member



My site (shop, off the shelf package) redirects dead pages to the home page. I have loads of supplemental pages with home page content and differing urls - the site was badly hit during Jagger, and now the internal pages are recovering, but the home page still won't rank for anything above page 100+.

jd01

4:18 pm on Feb 9, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The best rule of thumb seems to be:
If you will be replacing a page at another location with a similar page, then you should redirect.

If you will be removing the page and there is no replacement, then you should consider a custom 404 error page.

If you do use the custom error page remember:
1. noindex,nofollow the page.

2. you need to put the code in your .htaccess file yourself. (DO NOT use your server interface or account management software) If this is not set correctly, you will end up serving a 302 instead of a 404.

3. The following is the correct syntax:
ErrorDocument 404 /the/path/to/your/file.html

(DO NOT use http:// when setting the location.)

Hope this helps.

Justin

lammert

7:50 pm on Feb 9, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Some years ago I redirected all removed pages to the sitemap. This caused many duplicates and some of them are still sleeping in the index as supplemental results.

I now redirect them to a page similar to my sitemap with links to the most common pages on my site, but this page uses the robots meta "noindex" and it also returns a proper 404 HTML code. In this way I serve both the SE's and the visitors. The search engines see a 404 response code and a "noindex" tag which prevents duplicate content and the visitor gets a page that brings him to the needed information in only one or two steps. Only when there is an almost identical replacement page, I use a 301 redirect instead of this 404 page.

Kufu

4:56 pm on Feb 10, 2006 (gmt 0)

10+ Year Member



I recently redid one of my sites, and actually did a few 301 redirects to the home page. The site has now been fully crawled, and I haven't seen any negative effects.

I see how logically it would create a duplicate content issue, but this hasn’t been my experience. What I’ve seen so far is that the old non-existent page just gets dropped from the index.

g1smd

5:21 pm on Feb 10, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



>> I have loads of supplemental pages with home page content and differing urls <<

That is what happens when the redirect is a 302 redirect. You get the same content indexed under any URL that serves a 302 redirect and then takes you to that content. Make sure that the redirect is a 301 redirect and you avoid the problem.

g1smd

5:26 pm on Feb 10, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



>> did a few 301 redirects to the home page ..... I haven't seen any negative effects ..... I see how logically it would create a duplicate content issue, but this hasn’t been my experience. <<

The 301 redirect AVOIDS duplicate content issues. Only the single URL that returns "200 OK" is the one to be indexed. All of the other URLs are noted as being (301) redirects but nothing is indexed against those URLs, nor should it be.

Had you used a 302 redirect you would have been in big trouble.

Although the 301 redirect worked for you, it isn't the best solution. It isn't a good idea to redirect lots of sub-page URLs to the root index. Instead you should serve a custom error page, one that contains an error message and some basic site navigation. Served with a status of "404", Google will quickly drop those old URLs while allowing all visitors to still access the site.

Kufu

5:34 pm on Feb 10, 2006 (gmt 0)

10+ Year Member



g1smd,

Custom 404's are going to be my project this weekend ;)

g1smd

5:39 pm on Feb 10, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Make sure the custom page has <meta name="robots" content="noindex"> on it.

Make sure you check that the status (for URLs that no longer exist) really is "404" using WebBug or similar.

Kufu

5:55 pm on Feb 10, 2006 (gmt 0)

10+ Year Member



Thanks for the info. :)

Miop

11:03 am on Feb 11, 2006 (gmt 0)

10+ Year Member



< >> I have loads of supplemental pages with home page content and differing urls <<

That is what happens when the redirect is a 302 redirect. You get the same content indexed under any URL that serves a 302 redirect and then takes you to that content. Make sure that the redirect is a 301 redirect and you avoid the problem.>

I'm not sure what it is - it is an off the shelf shopping cart and the redirect is in the programming somewhere.
If you look up the headers of the redirected pages, it returns a 200 ok (which also means that you can't remove them from Google because it thinks they are valid pages). The company who created the shop won't provide support for changes in php coding, so I haven't a clue how to change it to redirect anywhere else. The only thing I can do is add a redirect to a 404 page to each specific dead product or section page, but I'm not sure how to do this even! A usual redirect in .htaccess?

g1smd

11:38 am on Feb 11, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



No, you never "redirect to a 404 page". In this case "redirect" is entirely the wrong terminology. A 404 page is a page that is served with a status code of "404" meaning that there is no page there to be indexed. The URL in the browser stays the same. The site responds with "404 - nothing here". There is no "redirect".

For your screwed up shopping cart (the designers of these things have no clue what they are doing) you need to detect when the redirect is occurring and add <meta name="robots" content="noindex"> to the <head> section of the page so that at least none of those fake URLs can get listed. The other advantage is that all of the existing duff listings will be dropped too.

jd01

4:34 pm on Feb 11, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Miop,

I suggest visiting the PHP forum... somewhere in the script there is a connection to the database --- It is usually best to set your headers after you connect and know if there are any results for what was requested.

To correct the 200/404 problem you can add a line something like this:

if(!$results OR $results==='') {
header("HTTP/1.0 404 Not Found");

Other stuff you would like to have on your error page here --- maybe open an html (custom 404) page. Be sure to follow the suggestions above and 'noindex' anything you display.

exit;
}

** The first line says if $results has not been set, or there is no information in $results serve a 404 status to the browser/user-agent.

If you would like to redirect for some reason, you will need something like this:

header ("HTTP/1.0 301 Moved Permanently");
header("Location: $URL");

** This one will set a 301 on your redirects.

Hope this gives you some ideas.

Justin

EDITED: Decided to translate what was in my head to readable English.