简体   繁体   中英

IIS 301 redirect specific url to another specific url

How can I redirect a url to another URL using IIS? For Example: I got http://www.aplusprint.co.nz/List.asp?id=58 Wish to redirect to https://eshop.aplusprint.co.nz/product/wall-flag/

I wish to one to one redirection which means when the id change the new url will change.

I create a test rewrite rule, but not working

<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>

Anyone can Help me?

OK, I found it.

<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>

Need a condition

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM