views:

705

answers:

2

I've already set default homepage for "www.mydomain.com" sucessfully. Now, I want to set default homepage for "sub.mydomain.com", but it throw 404 page if i don't type "sub.mydomain.com/default.aspx" ? The first and the second site are separate physical folders and virtual directories on iis7.

A: 

If I have understood you correctly, you have a single web server with many sites all on port 80 and you are using host headers to control which site a request goes to.

In this case you must specify the whole address, otherwise the server does not know which site to send it to.

Shiraz Bhaiji
A: 

In IIS, default site, properties, web site, advanced, you should see a list like;

default - 80

then "Add" in these two rows

 (all unassigned) : 80 : www.mydomain.com
 (all unassigned) : 80 : sub.mydomain.com

then default.aspx will go to the same page in both sites. ie. sub.mydomain.com is the same as www.mydomain.com.

However, if you want sub.mydomain.com to be a different website, then remove it from that list above and from IIS, Websites -> New Website ... yadda yadda yadda, then add in sub.mydomain.com as you did above.

Dead account