Domain redirection using PHP

For some reason we may need to redirect few domains or a domain name for some other domain for getting benefit of traffic for that particular domain then you can use following PHP script for setting up domain redirection facility. You will have put small PHP code in index file of the domain name for which you want to redirect.
For example, we will consider master domain as “maindomain.com” and domain which is to be redirected as “destination-domainname.com”
—————————————-
<?php
header(”Location: http://destination-domainname.com/”);
exit();
?>

—————————————-

Thus using above code we can redirect http://maindomain.com/index.php to destination-domianname.com

web hosting

Posted under Technology Updates, cpanel Hosting, cpanel hosting tips

This post was written by MATIC Actuators on August 3, 2009

Tags: ,

Comments are closed.

More Blog Post

Next Post: