2

I have website (ASP MVC, hosted on IIS) old pages that I want to redirect but for some reason I don't get it right. I tried with IIS rewrite and with web.config too.

For example I have old page called https://www.tanalyzer.com/Home/FAQ and I want to redirect it to https://www.tanalyzer.com/faq

What I have in web.config is

<rule name="Rewrite rule1 for urls-old-to-new">
<match url=".*" />
<conditions>
<add input="{urls-old-to-new:{REQUEST_URI}}" pattern="(.+)" />
</conditions>
<action type="Rewrite" url="{C:1}" appendQueryString="false" />

And for the rewrite map

   <rewriteMap name="urls-old-to-new"><add key="/Home/FAQ" value="/faq"></rewriteMap>
Ferryzijl
  • 642
  • 2
  • 8
  • 22

1 Answers1

0

ok i solved the issue

        <rule name="FAQ" patternSyntax="ECMAScript" stopProcessing="true">
      <match url="Home/FAQ$" />
      <conditions>
      </conditions>
      <action type="Redirect" url="https://www.tanalyzer.com/faq" redirectType="Permanent" />
    </rule>

I now have 12 rules in web.config, is it too much?