简体   繁体   中英

IIS URL 301 rewrite / redirect not working

I'm trying to do a 301 redirect using the IIS URL rewrite module. I've googled, looked at videos and put in different settings but it does nothing...meaning, the link I set up the redirect on still just works as before. I don't even get an error.

Here are my settings:

  • Requested URL: Matches the pattern
  • Using: Regular expressions << I've tried 'exact match' as well...same result, didn't work.
  • Pattern: Turf/ProductView.cfm?P=151
  • Ignore Case: checked
  • Action type: redirect
  • Redirect URL:https://www.weathermatic.com/products/6000-pro-rotors/{R:0}
  • Redirect Type: permanent 301

I've also tried using a Redirect URL that was within the same domain as the link I'm trying to redirect...again, nothing happens, the link still just works as before and no errors either.

Any help is so much appreciated.

在此处输入图片说明

Query string is not included in Match URL and? have different meaning in regex expression.

Please use {REUEST_URI} and \\? instead.

<rule name="rewrite rule" enabled="true" stopProcessing="true">
                <match url="(.*)" />
                <conditions>
                    <add input="{REQUEST_URI}" pattern="/Turf/ProductView.cfm\?P=151" />
                </conditions>
                <action type="Redirect" url="https://www.weathermatic.com/products/6000-pro-rotors/{R:0}" />

It will redirect Turf/ProductView.cfm?P=15 to https://www.weathermatic.com/products/6000-pro-rotors/Turf/ProductView.cfm?P=151

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