0

I have following rule for 301 redirects:

<rule name="301RedirectsRule" enabled="true" stopProcessing="true">
  <match url=".*" />
    <conditions logicalGrouping="MatchAll">
       <add input="{301Redirects:{URL}}" pattern="(.+)" />
    </conditions>
    <action type="Redirect" url="{C:1}" redirectType="Permanent" />
</rule>

In rewrite map there are rules:

<add key="/di/web/home/Glossary/index.aspx" value="/resources/dental-terminology" />
<add key="/di/web/knowledge-base/article.aspx?id=62" value="/resources/oral-pathology/oral-conditions-and-diseases/periodontal-disease" />

First one works perfectly, but any URL with parameter (like second one) doesn't work.

Alex
  • 389
  • 1
  • 3
  • 8

1 Answers1

1

I'm not entirely up to speed with the IIS rewrite module, but you could try to replace {301Redirects:{URL}} with {301Redirects:{REQUEST_URI}}.

I believe the first one does not contain the query string.

Jacco
  • 3,251
  • 1
  • 19
  • 29