SeoFilter Home Home | Tell a friend | About 
 Home | Services | Demo | Articles | Scripts | Purchase | Partners | Related | Support | Contact
  Scripts

Permanent Redictor - Free 301 Redirect Script

Introduction



This package contains a free redirect script that makes 301 permanent redirection.

Why should I need a Permanent Redirection ?

You need a Permanent Redirection if
  • You have changed a page name of your site and would like to point old requests to a new location.
  • You want to redirect Google Page Rank to the location.
  • You want your visitors/customers to see the new page instead of 404 Page Not Found error

Requirements

Apache 1.3.x or 2.x
PHP 4.3.0 or better

Installation

  1. Download permanent redirector package
  2. Unzip the package
  3. Edit "redirector.conf.php" and setup redirection for desired pages
  4. Download one of your "common" files of your site
    • config.php
      or
    • common.php
  5. Edit choosed file from previous step

    <?php
    include('redirector.php');
    // your code follows
    ?>
  6. Upload files
    • redirector.php
    • redirector.conf.php
    • the "common" file that was choosed at step 4

redirector.php file must be included BEFORE any output is produced from the script otherwise it won't work.
This script should be included from a file that is always loaded such as configuration or "common" file.

Another approach is that setting up this script to be called as 404 error handler.
in apache .htaccess

ErrorDocument 404 /path/to/redirector.php

Usage

redirector.conf.php looks like this:

<?php
// internal, redirection will be made in current domain
$redirector_url_map['partners.html'] = 'related.html';
$redirector_url_map['partners-partners1.html'] = 'related-related1.html';
$redirector_url_map['partners-partners2.html'] = 'related-related2.html';

// external url
$redirector_url_map['example.php'] = 'http://yahoo.com';

// default url
$redirector_url_map['_default'] = 'http://google.com';
?>

live usage

<?php

include('redirector.php');
.............

?>

Hello World.

Note:

Please note that if you have a single space or a new line this would break the redirection, so
do clear white spaces before: <?php and after ?>

Support/Customization

if there are some errors feel free to contact us.

Download



© 2006 Copyright SEOFilter.com