Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Lewis Smith 211 posts 620 karma points c-trib
    Jun 04, 2018 @ 13:00
    Lewis Smith
    0

    IIS Redirect for Lowercase

    Hi all,

    I'm trying to write an IIS redirect for lowercase which excludes Umbraco pages.

    I have tried the following without any luck:

    <rule name="LowerCaseRule1" stopProcessing="true">
         <match url="[A-Z]" ignoreCase="false" />
          <action type="Redirect" url="{ToLower:{URL}}" />
          <conditions logicalGrouping="MatchAny">
              <add input="{REQUEST_URI}" pattern="/umbraco" />
          </conditions>
     </rule>
    
    <rule name="LowerCaseRule1" stopProcessing="true">
         <match url="[A-Z]" ignoreCase="false" />
          <action type="Redirect" url="{ToLower:{URL}}" />
          <conditions logicalGrouping="MatchAny">
              <add input="{REQUEST_URI}" pattern="^/umbraco/*" />
          </conditions>
     </rule>
    

    Could anyone point me in the right direction? I want to exclude /umbraco and all urls with this.

    Thanks, Lewis

  • Nik 1617 posts 7263 karma points MVP 7x c-trib
    Jun 04, 2018 @ 13:33
    Nik
    101

    Hey Lewis,

    Looks like you are almost there. This is the Lower Case rule I use:

    <rule name="LowerCaseRule1" stopProcessing="true">
        <match url="[A-Z]" ignoreCase="false" />
        <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
            <add input="{URL}" pattern="/umbraco" negate="true" />
        </conditions>
        <action type="Redirect" url="{ToLower:{URL}}" />
    </rule>
    

    Cheers

    Nik

Please Sign in or register to post replies

Write your reply to:

Draft