#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2002
    Location
    Denton, Texas
    Posts
    2
    Rep Power
    0

    Question Redirection based on A records


    Forgive my long question ...

    I am trying to help a friend setup a website hosted on a shared server that allows him one IP address.

    Is there a way to use A records and individual domains to redirect the user from the root directory and page to the respective folder.

    Here is what I mean:

    Given the IP address: 111.222.333.444

    Given two domains: firstdomain.com, seconddomain.com

    firstdomain.com will translate to the IP address and then be directed to the /firstdomain directory

    seconddomain.com will translate to the IP address and then be directed to the /seconddomain directory

    A records assigned to each domain name will be redirected to to respective directories accordingly. (i.e. here.firstdomain.com = /firstdomain/here).

    With that complete ... is it possible to maintain the respective domain in the address bar of the browser?

    From what I can figure ... I need to extract the domain name and A record from the HTTP header. From that, I will add a script to the top of the root page that will redirect accordingly and also somehow keep the correct domain name in the address bar. Am I anywhere near correct?


    -Ty

    Comments on this post

    • JimmyGosling agrees
  2. #2
  3. Mobbing Gangster
    Devshed Demi-God (4500 - 4999 posts)

    Join Date
    Sep 2001
    Location
    "Best City" 2002 and 2003- Melbourne, Australia
    Posts
    4,912
    Rep Power
    33
    AFAIK, A records have nothing to do with that, and you set this up in .conf, probably you're looking for virtual hosts
    And you know I mean that.
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2002
    Location
    Denton, Texas
    Posts
    2
    Rep Power
    0
    I don't have any control of the server ... it's shared hosting.

    I can't modify any of IIS settings ... everything will have to be done based on scripts in the documents.

    I wish I had more control and could config the server ... better yet, dump Win2K and IIS and go with Red Hat and Apache.

    Any other guesses???
  6. #4
  7. Mobbing Gangster
    Devshed Demi-God (4500 - 4999 posts)

    Join Date
    Sep 2001
    Location
    "Best City" 2002 and 2003- Melbourne, Australia
    Posts
    4,912
    Rep Power
    33
    Sorry, I am out - never worked with IIS and not planing to.
    And you know I mean that.
  8. #5
  9. Banned ;)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2001
    Location
    Woodland Hills, Los Angeles County, California, USA
    Posts
    9,638
    Rep Power
    4247
    Well, if you don't have access to the IIS server, then you're going to have to use a script at the document root to determine the host name and redirect accordingly. Personally though, I would talk to your hosting provider and ask him/her/it to set up the two virtual hosts.

    This question shouldn't really be in the algorithms forum IMHO.
    Last edited by Scorpions4ever; February 16th, 2002 at 01:25 PM.
  10. #6
  11. No Profile Picture
    myOstrich Internet
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2001
    Posts
    28
    Rep Power
    0
    You can do this with URL forwarding at services like everydns.net and mydomain.com.

    -t

IMN logo majestic logo threadwatch logo seochat tools logo