【问题标题】:ASP.net URL rewriting conflicts with image folder?ASP.net URL 重写与图像文件夹冲突?
【发布时间】:2011-06-26 08:09:48
【问题描述】:

我有规则:

<rewrite url="~/construct2" to="~/construct2.aspx" processing="stop"/>
<rewrite url="~/construct" to="~/Handlers/PermRedirect.ashx?URL=construct2" processing="stop"/>

还有更多。

当我尝试访问时:

http://84.45.57.142/images/construct2-screenshot.jpg

似乎激活了这些规则并将您重定向到construct2.aspx。有谁知道为什么?我以为~/construct 只会匹配root directory/construct 而不是any directory/construct*

【问题讨论】:

    标签: c# asp.net url-rewriting


    【解决方案1】:

    试试:

    <rewrite url="~/construct2$" to="~/construct2.aspx" processing="stop"/>
    

    【讨论】:

    • @Tom Gullen - 这意味着正则表达式中的行尾。
    猜你喜欢
    • 2014-09-03
    • 1970-01-01
    • 2015-04-23
    • 1970-01-01
    • 2011-10-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-04-02
    相关资源
    最近更新 更多