gpt4 book ai didi

c# - 仅重定向根文件夹 web.config 上的 default.aspx

转载 作者:太空宇宙 更新时间:2023-11-03 12:57:12 25 4
gpt4 key购买 nike

http://foo.com/Default.aspx

http://foo.com/about/Default.aspx

http://foo.com/random/Default.aspx

                <rule name="Default Document" stopProcessing="true"> 
<match url="(.*)default.aspx" />
<action type="Redirect" url="{R:1}" redirectType="Permanent" />
</rule>

这会将所有/Default.aspx 重定向到/

我只需要将根目录中的 Default.aspx 重定向到/。那怎么办?时间差

最佳答案

终于,能够让它工作了。

            <rule name="root home" stopProcessing="true" patternSyntax="ExactMatch">
<match url="Default.aspx" ignoreCase="true" />
<action type="Redirect" url="/" redirectType="Permanent" />
</rule>

patternSyntax="ExactMatch"是解决问题所需要的。感谢您的帮助。

关于c# - 仅重定向根文件夹 web.config 上的 default.aspx,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33505655/

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