Why is it still necessary to create a virtual directory in IIS when website content is placed in the IIS root directory

Since the virutal directory points to the physical path of the application, therefore, if the IIS root directory is C: \ inetpub \ wwwroot and the application is stored on the D: \ websites, then we need to create a virtual directory, but if the application contents are placed in C: \ inetpub \ wwwroot, then why else do you need to create a virtual directory.

+4
source share
3 answers

In fact, you do not need to create a virtual directory. What you need to do is define it as an application folder by adding a default virtual directory to make it work. All you really need to do is right-click the folder under your site, click on the properties and click "Create" in the "Application Settings" section. Then your folder will have the gear icon to the side, designating it as the application folder.

As for why application folders are needed, I think this is a way to get you to choose which application pool you want to use for the application, and not for each application subdirectories running on the same default pool.

+2
source

IIS is not used simply for ASP.Net, it can serve PHP, for example .. Since the type of application and the pool varies, it is not created automatically and is not tied to the ASP.Net engine.

If you can clarify a little more of what you are trying to do, perhaps we can help further. For example, if you want to point the root application to another folder and this application or create another website, IIS allows you to do any of this ... you just need to update the question, with which version of IIS, how are the instructions between them.

+1
source

If one ASP.NET application is hosted on the IIS site, you can put it in the root directory (C: \ inetpub \ wwwroot), and you do not need to create a virtual directory, because when you create a site, it is already a virtual directory.

0
source

Source: https://habr.com/ru/post/1301195/


All Articles