I have a directory set up in the root of my main site (IIS Web Server, site in asp) that is a subdomain for the main site. My question is how do I set up a conditional 301 redirect in asp so that when people type in sub.mainsite.com it automatically goes to this directory and shows the whole subdomain site.
I tried this at the top of the default.asp page for the main site:
if Request.ServerVariables("SERVER_NAME") = "sub.example.com" then
It redirects to the subdomain, but if you click on any link on the subdomain website it says 404 not found.
Any help would be greatly appreciated!
[edited by: Ocean10000 at 3:50 pm (utc) on Jul 25, 2012]
[edit reason] examplefied [/edit]