Brontobytes Home

WEB HOSTING BLOG

 
 
 

Redirect visitors to another page using PHP

May 20th, 2007

Redirection in PHP can be done using the header () function. To setup a simple redirect, simply create an index.php file in the directory you wish to redirect from with the following content:

<?php header("Location: http://www.redirect.com/"); ?>

Where "http://www.redirect.com/" is the URL you wish the users to be redirected too. This can also be a file, like so:

<?php header("Location: directory/file.php"); ?>

Files can be of anytime including html, python, php, cgi, perl , and compiled cgi programs.

Leave a Reply

You must be logged in to post a comment.

HOME    |    WEB HOSTING     |    DOMAIN NAMES    |    SUPPORT    |    AFFILIATES    |    SITEMAP    |    LEGAL
Copyright © 2003-2008. Brontobytes Network | Web design by Brontopixels