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
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
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.
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
ASKER
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.
I think you answered my question though.
ASKER
is there any trick that can be applied with redirection?