Mohammedz.com

For Linux and Shell scripting.

Domain redirection using PHP script

3 Comments


If you want to redirect a domain to some other url, you can use the PHP script below.

index.php
—————————————-
<?php
header(“Location: http://destination-domain.com/where-you-want-to-redirect/index.html&#8221;);
exit();
?>
—————————————-

So, when you take http://your-domain.com or http://your-domain.com/index.php it will be redirected to “http://destination-domain.com/where-you-want-to-redirect/index.html&#8221;.

Advertisements

3 thoughts on “Domain redirection using PHP script

  1. or u can just use a simple javascript code..

  2. in which index page , i will include this php code.

    Destination domain index or redirecting domain index??
    In this case no need for .htaccess??

    My destination domain is http://www.voyagemarine.ae ,
    I want to redirect http://www.voyage-marine.com to http://www.voyagemarine.ae.

    Please guide me for the above…

  3. Nice tutorial….thanks for this post…..

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s