Domain re-pointing through PHP... ?

Discussion in 'Programming' started by salsan, Jul 15, 2010.

  1. #1
    I have to get re-pointed a domain like what i explained in the image by using PHP.

    [​IMG]
     
    salsan, Jul 15, 2010 IP
  2. Deacalion

    Deacalion Peon

    Messages:
    438
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #2
    DNS level redirection is not possible with PHP. If you only want to redirect HTTP traffic then go for this:
    
    <?php
    
        // however you determine what server to redirect to
        $server = 'host1';
    
        switch ($server) {
            case 'host1':
                header("Location: http://www.host1.comn.us/");
                break;
            case 'host2':
                header("Location: http://www.host2.comn.us/");
                break;
            case 'host3':
                header("Location: http://www.host3.comn.us/");
                break;
        }
    
        exit;
    ?>
    
    PHP:
     
    Deacalion, Jul 15, 2010 IP
  3. salsan

    salsan Active Member

    Messages:
    190
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    73
    #3
    If the DNS level redirection is not possible in PHP, then how i can do this ?
    Is there any other way to get this done???
     
    salsan, Jul 15, 2010 IP