Error 404

  • Onofrio
  • Born
  • Born
  • Onofrio
  • Posts: 4

Post 3+ Months Ago

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
  • Birmingham
  • Beginner
  • Beginner
  • User avatar
  • Posts: 47
  • Loc: Birmingham, UK

Post 3+ Months Ago

use htaccess for:
Code: [ Select ]
errordocument 404 /301.php


then use 301.php for:
Code: [ Select ]
<?
header("HTTP/1.1 301 Moved Permanently");
header("Location: http://www.homepage.com/");
exit;
?>
  1. <?
  2. header("HTTP/1.1 301 Moved Permanently");
  3. header("Location: http://www.homepage.com/");
  4. exit;
  5. ?>

Post Information

  • Total Posts in this topic: 2 posts
  • Users browsing this forum: Liamw411 and 95 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.