Help - Search - Members - Calendar
Full Version: Redirect 301
Zymic Webmaster Forums > Web Design & Development > Server Side Scripting > Other Languages
Zaccaria
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

__________________
You have never see gifts ideas like these? (idee regali on italian cultura generale)
PHP_Adam
You shouldn't get any penalties for duplicate pages, as they are not. Their just redirects.

Add this before or after your mod_rewrite or other redirects:
CODE
ErrorDocument 404 /index.php


Id recommend changing it though to
CODE
ErrorDocument 404 /index.php?404=1

That way you can also log your 404 errors, whilst they are redirected to your homepage.

Happy To Help,
PHP_Adam
Zaccaria
QUOTE(PHP_Adam @ Feb 2 2009, 11:44 PM) *
Id recommend changing it though to
CODE
ErrorDocument 404 /index.php?404=1

That way you can also log your 404 errors, whilst they are redirected to your homepage.


what it does so, excuse?
thanks
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.