web.config 可以有一个通用的 system.webserver 部分和其他带有位置标签的 system.web



我想将网址重写放在我所有网站的全局system.webserver部分中 - 但我想请求特定网站的过滤部分 - 我可以有一个"主要"system.webserver部分,然后在位置部分中有一堆其他部分吗?

是的,你可以有一个"全局"system.webServer部分(组(和许多"特定于位置"的配置部分,这些部分有自己的system.webServer部分(组(。 您可以在ApplicationHost.config和每个web.config中都有它。 不过,您的问题的一个问题是要求web.config中的通用system.webServer部分适用于所有站点。 除非所有站点共享相同的物理路径,否则将无法对所有站点使用单个 web.config。 相反,您希望将此配置放在 ApplicationHost.config 中。 一些轻松的阅读:https://learn.microsoft.com/en-us/iis/get-started/planning-your-iis-architecture/getting-started-with-configuration-in-iis-7-and-above

相关内容

最新更新