gpt4 book ai didi

xml - Azure 网站上的尾部斜杠

转载 作者:行者123 更新时间:2023-12-02 07:26:39 25 4
gpt4 key购买 nike

Azure 网站上以斜杠结尾的 URL 请求存在问题: https://www.host.com/path/index.htm - 在职的 https://www.host.com/path/index.htm/不工作

我在根文件夹中web.config的system.webServer中添加了以下规则:

<rule name="AddTrailingSlashRule1" stopProcessing="true">
<match url="(.*[^/])$" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" pattern="(.*?)\.htm$" negate="true" />
<add input="{REQUEST_FILENAME}" pattern="(.*?)\.html$" negate="true" />
<add input="{URL}" pattern=".*/[^.]*\.[\d\w]+$" negate="true" />
</conditions>
<action type="Redirect" url="{R:1}/" />
</rule>

并不能解决问题。我错过了什么?

最佳答案

向 Microsoft 支持寻求帮助...这是对我有用的正确答案:

       <rule name="Remove trailing slash" stopProcessing="false">
<match url="(.*)/$" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsFile" />
</conditions>
<action type="Redirect" redirectType="Permanent" url="{R:1}" />
</rule>

已添加到文件夹本身的 web.config 中。不在根文件夹中。

关于xml - Azure 网站上的尾部斜杠,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51880553/

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