Copied to clipboard

Flag this post as spam?

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


  • Adrian Wu 53 posts 266 karma points
    Feb 26, 2019 @ 20:31
    Adrian Wu
    0

    Google sees two versions of Umbraco page url issue

    Hi team,

    by default , Umbraco generates the url for the page with the trailing slash like this https://www.mysite.co.nz/contact-us/.

    But when we did the SEO testing, Google sees it as 2 different pages (with and without trailing slash) served with similar content, creating a duplicate content issue :

    https://www.mysite.co.nz/contact-us/
    https://www.mysite.co.nz/contact-us

    How can we address this issue ?

    Thanks,

    A

  • Alex Skrypnyk 6182 posts 24284 karma points MVP 8x admin c-trib
    Feb 26, 2019 @ 21:42
    Alex Skrypnyk
    100

    Hi Adrian

    First, disable trailing slash in umbracoSettings.config:

      <!-- this will add a trailing slash (/) to urls when in directory url mode -->
        <addTrailingSlash>false</addTrailingSlash>
    

    Second, add redirect:

    <rewrite>
      <rules>
        <rule name="Remove slash" stopProcessing="true">
          <match url="(.*)/$" />
          <conditions>
            <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
            <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
          </conditions>
          <action type="Redirect" redirectType="Permanent" url="{R:1}" />
        </rule>
    
      </rules>
    </rewrite>
    

    Thanks,

    Oleksandr

  • Adrian Wu 53 posts 266 karma points
    Mar 05, 2019 @ 21:13
    Adrian Wu
    0

    Hi , Alex, thanks for the advise.

    looks like other pages showing fine like this https://www.mysite.online/page1

    but the home page still have the trailing slash https://www.mysite.online/

    Thanks,

    A

  • Adrian Wu 53 posts 266 karma points
    Mar 07, 2019 @ 20:19
    Adrian Wu
    0

    hi Alex, this rewrite rule causing the "Preview" is not working.

    Because it changes the js url from

    https://www.mysite.co.nz/umbraco/js/canvasdesigner.loader.js

    to

    https://www.mysite.co.nz/js/canvasdesigner.loader.js.

    any chance to exclude this condition ?

    Thanks,

    A

  • 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