【问题标题】:IIS 7 URL Rewrite - 403 ErrorIIS 7 URL 重写 - 403 错误
【发布时间】:2012-04-12 01:28:07
【问题描述】:

我知道以前有人问过这个问题,但我还没有找到我遇到的问题的答案。我正在尝试将域(不是子域)重定向到子文件夹。我正在运行 IIS 7,并创建了这样的 URL 重写规则:

<rule name="subfolder" enabled="true" stopProcessing="true">
    <match url="(.*)" />
    <conditions logicalGrouping="MatchAll">
        <add input="{HTTP_HOST}" pattern="^(www\.)?domain.com$" />
        <add input="{PATH_INFO}" pattern="subfolder" negate="true" />
    </conditions>
    <action type="Rewrite" url="/subfolder/{R:0}" />
</rule>

关闭规则后,我可以导航到类似http://domain.com/subfolder/index.htm 的页面。启用它后,当我尝试导航到 http://domain.com/index.htm 时出现 403 错误。

403 - Forbidden: Access is denied.

You do not have permission to view this directory or page using the credentials that you supplied.

我该如何解决这个问题?

【问题讨论】:

    标签: iis url-rewriting


    【解决方案1】:

    试试这个简单的规则:

    <rule name="Redirect domain to sub-folder" stopProcessing="true">
        <match url="^$" />
        <action type="Redirect" url="http://domain.com/subfolder" />
    </rule>
    

    【讨论】:

    • 谢谢。我希望不要重定向,但这可能是我唯一的选择。
    猜你喜欢
    • 2013-07-01
    • 1970-01-01
    • 2012-12-26
    • 1970-01-01
    • 2014-05-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多