views:

16

answers:

1

We have two subdomains for the same site, we would like that depending on the visited subdomain the initial page varies. But in IIS the default document setting is based on the web.config so...

We know that we could use the http:/subdomain/page.aspx but its a requirement that we use only http:/subdomain in the links

Desired example:

  • Click in link http:/subdomain1.web.com --> http:/subdomain1.web.com/page1.aspx (our_website/page1.aspx)
  • Click in link http:/subdomain2.web.com --> http:/subdomain2.web.com/page2.aspx (our_website/page2.aspx)
+1  A: 

Just use the same default document and write a redirect in Page_Load based on which domain is requested.

klausbyskov
Althought it would be useful to have some kind of option to have diferent default pages per subdomain in IIS (You save one redundant petition...)
ase69s
@ase65s Hehe, well you could also code the defaultpage such that it displays correctly for both subdomains. That would save you the extra request too. I'm guessing it is a matter of appearance for the page? If so you could use different themes based on the subdomain. Basically I think my position is that there are so many ways to solve your problem that multiple default pages in IIS is just not necessary ;-)
klausbyskov
@ase65s, btw, if you do a Server.Transfer instead of Request.Redirect, you save the extra request too.
klausbyskov