Put ASP.NET MVC application in a subdirectory of the main MVC application?

I have my main website application on my server in C:\inetpub\wwwroot , which I can view at http://www.mysite.com

I created another separate MVC web application called Subdir . I would like to configure it so that if I am at http://www.mysite.com/Subdir it will launch my Subdir application.

What do I need to do for this? I obviously can't just drop the application in C:\inetpub\wwwroot\mysite.webui\whatever . Do I need to install the application in a specific directory? Do I need to configure anything in IIS?

+6
source share
2 answers

Yes, you can opt out of the application in a subfolder of your original application, but the important thing is how you configure IIS for this new application. I recommend using sisters / parallels folders as best practice.

  • Expand your applications in the sibling folder:

    c:\inetpub\wwwroot\ - your main application

    c:\inetpub\mynewapp\ for your add-on application.

  • In IIS, expand your existing website and add a new application by pointing the root folder to c:\inetpub\mynewapp\

Result:

http://mysite = c:\inetpub\wwwroot\

http://mysite/mynewapp/ = c:\inetpub\mynewapp

You are all well and that’s a pretty recognized "best practice" since you can now simplify NTFS and App Pool Identities identification. Browse the information on these topics and you will be one step ahead of the game with your sites deployed in this way.

+4
source

I obviously can't just drop the application in C:\inetpub\wwwroot\mysite.webui\whatever

Wrong.
You need to do just that.

Just mark this directory as an application in IIS Manager, and you will go well.

+5
source

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


All Articles