Why is IIS going to the wwwroot folder instead of the one I want it to?

StackOverflow https://stackoverflow.com/questions/23421223

  •  13-07-2023
  •  | 
  •  

سؤال

For the default Web Site in IIS I have the following binding on the default website:

enter image description here

I have the following binding on the site I want to access:

enter image description here

When I access the site in the browser with localhost/hostname, I'm pointed to C:\inetpub\wwwroot*hostname*. I have another site set up with a hostname binding that uses the same values for Port and IP Address and it points to the right place (a different folder on my C: drive). I'm running my site locally and I have the correct hostname entry in my hosts file. I don't want to create two separate virtual directories under a single website, I want the sites to be available as separate websites. What am I missing?

هل كانت مفيدة؟

المحلول

When you use the hostname feature in iis, you cant use localhost to access the site any more.

Instead use http://myhostname and setup myhostname to point to 127.0.0.1 in your hosts file.

If you want to access the site via localhost, that implies you need to make a virtual directory, or "application" in iis.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top