gpt4 book ai didi

regex - IIS 请求过滤允许 URL

转载 作者:行者123 更新时间:2023-12-03 22:53:01 25 4
gpt4 key购买 nike

我正在使用 IIS7 请求过滤(网站级别),其中“允许未列出的文件扩展名”设置为未选中。在我访问我的 Web 应用程序时进行此设置后,说 _http:/machine_name/app1 然后它失败了。在“文件扩展名”下添加正确的文件扩展名后,它开始运行,但后来当我浏览应用程序中的其他链接时失败。我发现我需要在“允许 URL”下添加 URL,但我确实有大量的 URL 列表需要添加,例如:
'/app1/prop1'、'/app1/prop1/services/'、'/app1/prop2/repository'..... 等等
所以,我看到像/app1/* 这样的模式,但“允许 URL 不允许任何模式匹配”。有什么办法可以到添加正则表达式 在 IIS 中的某处,以便 可以允许匹配的 URL .

提前致谢。

最佳答案

我认为像“/app1/prop1”、“/app1/prop1/services/”、“/app1/prop2/repository”这样的 URL 不适用于 'Allow unlisted file name extensions'设置为 false因为您不允许无扩展请求。

允许无扩展请求 , 添加 <add fileExtension="." allowed="true" />到您的 web.config 如下:

  <system.webServer>
<security>
<requestFiltering>
<fileExtensions allowUnlisted="false">
<add fileExtension="." allowed="true" />
</fileExtensions>
</requestFiltering>
</security>
</system.webServer>

如果这有帮助或问题仍然存在,请告诉我。

关于regex - IIS 请求过滤允许 URL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24034498/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com