Copied to clipboard

Flag this post as spam?

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


  • Claushingebjerg 886 posts 2415 karma points
    Dec 18, 2019 @ 12:08
    Claushingebjerg
    0

    UrlAlias, redirects, www and https

    Umbraco 7.5.4

    so a bit of a mind bender for me...

    I have a site where i redirect the user to the "https" version of the site, and then on to the "www", like so

        <rule name="Redirect to https" stopProcessing="true">
         <match url="(.*)" />
         <conditions>
          <add input="{HTTPS}" pattern="off" ignoreCase="true" />
         </conditions>
         <action type="Redirect" redirectType="Permanent" url="https://{HTTP_HOST}/{R:1}" />
        </rule>
    
    <rule name="Canonical name" stopProcessing="true">
     <match url="(.*)" />
      <conditions>
       <add input="{HTTP_HOST}" negate="true" pattern="^www\.mydomain\.dk$" />
      </conditions>
      <action type="Redirect" url="https://www.mydomain.dk" redirectType="Permanent" />
    </rule>
    

    The thing is, now UrlAliases only work on the "www" version of the site, on the "non www" i get the front page of the site...

  • Yakov Lebski 427 posts 1654 karma points
    Dec 23, 2019 @ 18:38
    Yakov Lebski
    100

    All non www do redirect to homepage in your case? I think that you miss {R:1} in canonical name -

    <rule name="Canonical name" stopProcessing="true">
     <match url="(.*)" />
      <conditions>
       <add input="{HTTP_HOST}" negate="true" pattern="^www\.mydomain\.dk$" />
      </conditions>
      <action type="Redirect" url="https://www.mydomain.dk/{R:1}" redirectType="Permanent" />
    </rule>
    
  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies