Racking my brains on how to get this to work on IIS using url rewrite
There are 1000s of URLs on a website I work for that are old .html files that need 301 redirecting.
Most can be caught as they have a similar syntax:
OLD URLS:
/acatalog/nike_shoes_red_sneaker.html
/acatalog/nike_shoes_blue_sneaker.html
/acatalog/nike_shoes_sandal.html
NEW URL:
/nike
So tried the following rule:
<rule name="redirect_nike" stopProcessing="true">
<match url=".*" ignoreCase="true" />
<conditions><add input="{REQUEST_URI}" pattern="^/acatalog/nike_shoes(.+)" /></conditions>
<action type="Redirect" url="/nike" appendQueryString="false" redirectType="Permanent" />
</rule>
Also tried:
<rule name="ACatalog_Curvy_kate" patternSyntax="Wildcard" stopProcessing="true">
<match url="*.html" ignoreCase="true" />
<conditions><add input="{REQUEST_URI}" pattern="^/acatalog/nike_shoes(.*)" /></conditions>
<action type="Redirect" url="/nike" appendQueryString="false" redirectType="Permanent" />
</rule>
But it’s still throwing a 404 error. Any ideas how I can fix this?
Thanks in advance! Jorge