How to Redirect a Website?

Discussion in 'Site & Server Administration' started by bushib, Jun 5, 2008.

  1. #1
    Hi there,

    I want to know that how to redirect a website to another. i.e. if a person opens www.abc.com it should be redirected towards the www.xyz.com.

    How to do it on the Linux hosting ?

    Secondly doing so is allowed by Google or not?

    Regards
    bushib
     
    bushib, Jun 5, 2008 IP
  2. Tom__

    Tom__ Peon

    Messages:
    148
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    index file:
    <?php
    header("Location: http://www.newwebsite.com");
    ?>
    PHP:
     
    Tom__, Jun 5, 2008 IP
  3. bushib

    bushib Banned

    Messages:
    1,096
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Hi there,

    Can anyone please explain how to use this code?

    Regards
    bushib
     
    bushib, Jun 5, 2008 IP
  4. Camay123

    Camay123 Well-Known Member

    Messages:
    3,423
    Likes Received:
    86
    Best Answers:
    0
    Trophy Points:
    160
    #4
    I beleiev you would be better serve by modifying .htaccess with the following:

    Please REPLACE www.newdomain.com in the above code with your actual domain name.
     
    Camay123, Jun 5, 2008 IP
  5. Camay123

    Camay123 Well-Known Member

    Messages:
    3,423
    Likes Received:
    86
    Best Answers:
    0
    Trophy Points:
    160
    #5
    Create an empty index.php file , paste this code and upload it to your root public folder. Thats is if you want to do this.
     
    Camay123, Jun 5, 2008 IP