Configuring subdirectory authentication mode in applications hosted under root site

前端 未结 5 1420
甜味超标
甜味超标 2021-02-12 17:50

On my local machine, I work on multiple web sites and run them under IIS under a \"Default\" web site. That way I can access the sites through this type of URL: http://localhos

5条回答
  •  借酒劲吻你
    2021-02-12 17:56

    You can't change the Authentication mode within a subdirectory. Only WebApplications can define this setting which applies to the entire application. A location element is only used in subdirectories to change authorization, not authentication settings.

    You need to create the subdirectories as Web applications in IIS.

    If you are saying the child subdirectory is in fact already a web application in IIS (the error suggests this is not the case), then you need to disable inheritance. This has nothing to do with whether you have a web.config in the root. If not it just means it's using the default machine config settings.

    You can disable inheritance by adding a web.config in the root, with the following element wrapping your system.web.

    
       
           ...
       
    
    

提交回复
热议问题