Link to home
Create AccountLog in
Avatar of twinfrey
twinfrey

asked on

DNS Entry/Host Header

Is there a way to point a host header or dns entry to a virtual directory?  that is a quip entry x could point to http://x/y
ASKER CERTIFIED SOLUTION
Avatar of Ruscal
Ruscal
Flag of United States of America image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Avatar of twinfrey
twinfrey

ASKER

Yes. that approach i considered but there are more invitees to the party.  this is a commerce server solution that we are trying to tackle a specific problem.  To move it to another web site is quite a bit of configuration.

is there any trick that can be applied with redirection?
not in the web server itself, but you could make your default page on the server a scripted page that looks at the value passed as the hostname and then does the switching based on that.

in asp.net i'd be something like having a default.aspx page with the following tidbit of code in it.

Then if you went to mail.domain.com it would redirect you to www.domain.com/mail otherwise it'd take you to index.html

The variations from that point all depend on the number of sites you want to do this with, but from that point it should be academic.

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    If Request.Url.Host = "mail.domain.com" Then
        Response.Redirect("http://www.domain.com/mail/", True)
    Else
        Response.Redirect("http://www.domain.com/index.html", True)
    End If
End Sub

Open in new window

Thought about that too, but the requesting object is not the user.  That is, in this case, the site has external links requesting marketing information from a virtual directory path.  So I am not sure that an asp redirect would return the correct response.

I think you answered my question though.