Page not found

They have: 2 posts

Joined: Feb 2009

Hi guys
I must insert in a html site a htaccess file that create a redirect 301 to
the site home page for every page that gives error 404 (Page not found), but
without affecting the single redirect 301 already present in the file
htaccess regarding other subpage moved and renamed in the past.

The purpose of all of this is not losing the google page rank that can be
passed trough every bad written back link .

What do I write in the htaccess file to do this? Do I have to write it
before or after the existing rules?

Usually I have only one or two error 404 for months to redirect: I wouldn't have to have a penalty for duplicate pages, isn't it?

Thank you

{sig removed}

Megan's picture

She has: 11,421 posts

Joined: Jun 1999

Wouldn't you just put your index page in as your error 404 doc? You can specify a custom 404 page in your .htaccess like this:

ErrorDocument   404  /404.php

I think redirecting 404's to the home page is a bad idea mainly because it's a problem for users who click on those links. All of a sudden they are presented with your home page and not the page they thought they were gettting. Better to provide an actual 404 page that explains the problem and then provides links to other appropriate pages on your site.

I think Google themselves would really prefer that you actually send a 404 error code so they know that the page no longer exists.

What you should also do is sign up for Google Webmaster Tools and check your 404 pages. If you're getting a lot of hits to a certain url, 301 redirect it to an appropriate existing page on your site and/or contact the linking page(s) and ask them to change the link. Webmaster Tools also has code for a 404 widget that can help make your 404 page more useful.

Or are you getting a huge amount of badly written inbound urls? Any reason why that's happening?

Here are a few more blog posts on 404's from Google:

http://www.google.com/search?hl=en&safe=active&rls=en&hs=coQ&q=+site:goo...

Wilky wrote:

Usually I have only one or two error 404 for months to redirect: I wouldn't have to have a penalty for duplicate pages, isn't it?

I'm not sure what you mean by this??

By the way, if you want to use a signature here, please go t you "My Account" area from the right sidebar and change your signature there.

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.