Skip to content

Increase font size Decrease font size Default font size
You are here: Home arrow Support arrow FAQs arrow PHP arrow How do I redirect visitors to another page using PHP?
How do I redirect visitors to another page using PHP? Print E-mail
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 but not limited to HTML, python, php, cgi, perl , and compiled cgi programs.
 
< Prev
 

Customers Login






Lost Password?