2
votes

I'm using the IIS URL rewrite add-on in my Sitecore v7.2 website to handle redirects.

I've setup the Rewrites on the website node in IIS and not on the top level IIS server.

These are simple redirects such as appending a slash in certain situations

 <rule name="CA Redirect" stopProcessing="true">
    <match url="^ca$" />
    <action type="Rewrite" url="{R:0}/" />
  </rule>

I'm finding that unless I add the path e.g. "/ca" to the IgnoreUrlPrefixes in Sitecore IIS will not process the redirect, and it appears that Sitecore is handling the request before the URL rewrite rule.

Has anyone else come across this issue? Should the rules be added at the top level rather than the website level?

1

1 Answers

0
votes

We're using redirects at website level and it works without problems. IIS is redirecting before Sitecore handles the request. Doing it at site level is generating this in the web.config

<rewrite>
       <rules>
             <rule name="Web closed" enabled="true" stopProcessing="true" patternSyntax="Wildcard">
                    <match url="*" />
                    <action type="Rewrite" url="/holdingpage.html" logRewrittenUrl="true" redirectType="Temporary" />                   
              </rule>
        </rules>
</rewrite>