# How to setup differend default document for two sites IIS 7

I Have two domains,

domain-one.com is ok it will point to index.asp domain-two.com should point on index2.asp

The system is huge, that is reason why we are using existing asp scripts, we have migrated to new server and there was IIS 6 where you could set default document for each page, but in this IIS 7 I can't find an option.

-
Why not create multiple folders to host the individual sites and let host headers do their job? You can set the default documents on a per-site basis. And I think maybe even on a per-folder basis... –  Tom Wijsman Sep 12 '11 at 18:58

Best solution -

Create two different sites in IIS and set the Host Headers in each for different domains with a different root path (c:\inetpub\site1 and c:\inetpub\site2) for example.

Workaround and easiest solution if the sites do not need to be isolated -

In your main domain, create a new default page called selector.asp which has the highest priority and copy the following:

<%

site1www = "www.site1.com"
site1 = "site1.com"

if request.servervariables("SERVER_NAME") = site1www or request.servervariables("SERVER_NAME") = site1 then

response.redirect("index.asp")

end if

site2www = "www.site2.com"
site2 = "site2.com"

if request.servervariables("SERVER_NAME") = site2www or request.servervariables("SERVER_NAME") = site2 then

response.redirect("index2.asp")

end if

%>


This will look at the host header and redirect people to the correct page! Just change site1.com / Site2.com for the address!

-