【问题标题】:IIS 301 redirect specific url to another specific urlIIS 301 将特定 url 重定向到另一个特定 url
【发布时间】:2018-05-29 04:03:54
【问题描述】:

如何使用 IIS 将一个 URL 重定向到另一个 URL? 例如: 我得到了http://www.aplusprint.co.nz/List.asp?id=58 希望重定向到 https://eshop.aplusprint.co.nz/product/wall-flag/

我希望一对一重定向,这意味着当 id 更改时,新 url 将更改。

我创建了一个测试重写规则,但不起作用

<configuration>
<system.web>
    <identity impersonate="true" />
<httpRuntime maxRequestLength="8192" />
</system.web>
<system.webServer>
    <rewrite>
        <rules>
            <rule name="wall_mounted_flag" patternSyntax="ExactMatch" stopProcessing="true">
                <match url="List.asp?id=58" />
                <action type="Redirect" url="https://eshop.aplusprint.co.nz/product/wall-flag/" appendQueryString="false" />
            </rule>
        </rules>
    </rewrite>
    <httpErrors errorMode="Detailed" />
 </system.webServer>

谁能帮帮我?

【问题讨论】:

  • &lt;rule name="About Us Redirect" patternSyntax="ExactMatch" stopProcessing="true"&gt; &lt;match url="Aboutus.asp" /&gt; &lt;action type="Redirect" url="https://eshop.aplusprint.co.nz/aboutus/" appendQueryString="false" /&gt; &lt;/rule&gt; 可以工作

标签: asp.net redirect iis url-redirection


【解决方案1】:

好的,我找到了。

<rule name="wall_mounted_flag" patternSyntax="ExactMatch" stopProcessing="true"> <match url="List.asp" /> <action type="Redirect" url="https://eshop.aplusprint.co.nz/product/wall-flag/" appendQueryString="false" /> <conditions> <add input="{QUERY_STRING}" pattern="id=58" /> </conditions> </rule>

需要一个条件

【讨论】:

    猜你喜欢
    • 2015-10-28
    • 2019-04-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-02-15
    • 1970-01-01
    • 2020-09-06
    • 1970-01-01
    相关资源
    最近更新 更多