Copied to clipboard

Flag this post as spam?

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


  • Jon Free 14 posts 34 karma points
    Apr 15, 2016 @ 16:03
    Jon Free
    0

    URL Rewrite Rule breaks Login

    I've applied the following rewrite rule via IIS 7's rewrite module and it seems to break the login page. Why would that be?

        <rule name="LowerCase" stopProcessing="true">
          <match url="[A-Z]" ignoreCase="false" />
          <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
          <action type="Redirect" url="{ToLower:{URL}}" />
        </rule>
    
  • Sebastiaan Janssen 4847 posts 14391 karma points MVP admin hq
    Apr 16, 2016 @ 08:23
    Sebastiaan Janssen
    0

    Probably because the login posts to PostLogin which then gets redirected and in that redirect your posted values get lost.

    First of all: I'll make an assumption that you're doing this for SEO purposes.. in which case you should probably stop listening to SEO swindlers, the casing of the URLs really doesn't matter ;-)

    But if you must do this you can to fix this:

    <rules>
        <rule name="LowerCase" stopProcessing="true">
            <match url="[A-Z]" ignoreCase="false" />
             <conditions>
              <add input="{URL}" negate="true" pattern="^~/umbraco$" />
             </conditions>
            <action type="Redirect" url="{ToLower:{URL}}" />
        </rule>
    </rules>
    

    You might still run into other unexpected problems though, good luck! :-)

  • Jon Free 14 posts 34 karma points
    Apr 19, 2016 @ 10:34
    Jon Free
    0

    Hmmm it doesn't match the urls for some reason and on the basis of I personally hate Regex I think I'll just leave it out...

  • twizted 1 post 71 karma points
    May 09, 2016 @ 14:04
    twizted
    0

    I had this problem today and found a solution:

    <rewrite>
        <rules>
          <!-- Redirect rule to force all URLs to lowercase -->
          <rule name="LowerCaseRule" stopProcessing="true">
            <match url="[A-Z]" ignoreCase="false" />
            <action type="Redirect" url="{ToLower:{URL}}" />
            <conditions>
              <add input="{REQUEST_URI}" pattern="^.*/umbraco" negate="true" />
              <add input="{REQUEST_URI}" pattern="^.*/install" negate="true" />
            </conditions>
          </rule>
        </rules>
      </rewrite>
    
Please Sign in or register to post replies

Write your reply to:

Draft