Changing the default directory page based on domain

Discussion in 'Site & Server Administration' started by WAK47, Feb 18, 2007.

  1. #1
    Hi,

    I'm trying to edit my .htacess file so that the default directory page will changed based on which domain name was entered. For instance, if google.com is entered, it will bring the user to one page. However, if images.google.com is entered, it will bring the user to a different page in the same directory.

    Thanks for your help!
     
    WAK47, Feb 18, 2007 IP
  2. ThomasNederman

    ThomasNederman Peon

    Messages:
    112
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I would use getenv("HTTP_REFERER")

    if (getenv("HTTP_REFERER") == 'image.google.com'){
    header("HTTP/1.1 301 Moved Permanently");
    header("Location: http://"page.com");

    }else{
    header("HTTP/1.1 301 Moved Permanently");
    header("Location: http://anotherpage.com");

    }
     
    ThomasNederman, Feb 19, 2007 IP
  3. WAK47

    WAK47 Peon

    Messages:
    19
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    That doesn't really work the way I want it to. Instead of redirecting to a certain page, I want each domain to actually point to a different page in the same directory.
     
    WAK47, Feb 19, 2007 IP