We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 25803 ☆ A M B ☆
    • 721 Posts
    Would the Canonical extension help?
      • 46630
      • 40 Posts
      Do you have experience with that extra. What kind of link structure outputs?
        • 25803 ☆ A M B ☆
        • 721 Posts
        You can install it and see for yourself. It outputs the full URL of the page, ie.
        http://www.somesite.com/gallery.html
          • 45534
          • 8 Posts
          This works with "Use Friendly Alias Path" and friendly URLs:
          <link rel="canonical" href="[[++site_url]][[*id:isnot=`[[++site_start]]`:then=`[[*uri]]`]]">
            • 46630
            • 40 Posts
            Quote from: mcnickel at Mar 11, 2014, 03:51 PM
            This works with "Use Friendly Alias Path" and friendly URLs:
            <link rel="canonical" href="[[++site_url]][[*id:isnot=`[[++site_start]]`:then=`[[*uri]]`]]">

            Yes it works but that also gives me the full friendly URL.
              • 46630
              • 40 Posts
              Quote from: rx2 at Mar 11, 2014, 03:44 PM
              You can install it and see for yourself. It outputs the full URL of the page, ie.
              http://www.somesite.com/gallery.html

              Thanks but this extra also gives me the full freindly URL of the resource.
                • 46630
                • 40 Posts
                Maybe this could be a solution even it is ugly:


                <link rel="canonical" href="[[++site_url]][[*id:isnot=`[[++site_start]]`:then=`index.php?id=[[*id]]`]]">


                This outputs:
                http://site_url/index.php?id-X
                which redirects directly to the resource friendly url.

                Could someone tell me the Modx way to do this?
                  • 44234
                  • 219 Posts
                  Quote from: ispasov at Mar 11, 2014, 01:25 PM

                  So I want to inform the search engines that this is the static link and if the url of the resource has changed (the resource is moved under different parent resource) the canonical url stays the same.

                  Maybe someone could give me better approach to do this.

                  I'm not sure that using 'rel="canonical"' in this way will achieve what you want. According to Google:
                  The rel="canonical" attribute should be used only to specify the preferred version of many pages with identical content.

                  I believe the best way to tell Google, Bing etc of url changes is by using their Webmaster Tools. http://www.genedelibero.com/ask-google-to-re-index-or-crawl-a-page-or-web-site/
                    Find me on Twitter, GitHub or Google+