Here is one way to do this (as recommended by 1and1.com if you host multiple domains). Put this at the root of your web space. All your websites will point to this root. The script below forwards the requests to the appropriate subfolder. This is a kind of hack, but if you do not have full control over IIS settings, this will work.
Name this file default.asp:
<%EnableSessionState=False
host = Request.ServerVariables("HTTP_HOST")
if host = "website1.com" or host = "www.website1.com" then
response.redirect("http://website1.com/website1/default.aspx")
elseif host = "website2.com" or host = "www.website2.com" then
response.redirect("http://website2.com/website2/default.aspx")
else
response.redirect("http://website1.com/")
end if
%>
source
share