Saturday 29 October 2011

How to redirect a URL or website in PHP


Create a file called index.php and add the following code in it


<?php
header("location:http://domain.com/cgi-bin/dir1/dir2");
exit;
?>
If you put this file in the DocumentRoot of domain.com, the URL http://domain.com will be automatically redirected to http://domain.com/cgi-bin/dir1/dir2

No comments:

Post a Comment