简体   繁体   中英

Difference between creating my asp.net MVC web application ,under the IIS Default web site, or create it as a new web site

I have published my asp.net MVC web application under the “Default web site” inside IIS. I actually added two versions of my web application:-

  • one directly under the default website and it can be accessed by typing http://servername
  • one under presaging path , and can be accessed by typing http://servername/prestaging

so I got confused on which approach it is recommend to add my asp.net web application, and what is the difference between adding my web application under the default web site, or creating a whole new web site ?

Thanks

This has more to do with organization within your company's IIS structure than right and wrong. If the site you built truly is the only site on the server, putting it on the Default site is not looked down upon.

But if the application is a sub application of the default site, the latter approach is the more appropriate approach if you only get to access the site from the //servername URL.

If you have a separate domain, myapp.servername.com, you can install it into the default iis site and add a binding or you could create a whole separate web site.

Has more to do with your structure than right or wrong.

Edit To answer your comment, creating the site under the default web site will make the URL in most cases be: ' http://myservername/MyApp '. Creating your own application would require (in most cases) a separate binding address, ' http://myapp.myservername.com ' It is really only affecting the URL you place in your browser and nothing else. More complicated setups are possible, but for most cases, these are your two options.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM