Canonical relative links on Pagebuilder pages?

Options
So, a pagebuilder page URL can be two ways it seems:

https://secure.site.org/site/SPageNavigator/Page_Name.html

or

https://secure.site.org/site/SPageServer?pagename=%2FPage_Name


Google sees these are two separate pages with duplicate content and titles. Has anyone come up with and tested the the best way to create a canonical URL to say they are both the same? I would assume it to be something like:

https://secure.site.org/site/SPageNavigator/[SOME S TAG TO GRAB PAGE NAME].html


I am not quite sure how to use or properly format a S-tag to grab the relevant page name. Can anyone help with this?
Tagged:

Comments

  • With pagebuilder URL you want to use the 2nd one preference wise/ideally, and the 'correct' formating for that page when called through the use of "pagename" parameter would be

    https://secure.site/org/site/SPageServer?pagename=Page_Name (without that encoded / of %2F)


    Speaking from a web developer perspective (and not GA analyst / SEO SME):
    • One of the reason you want to use that is because you could use the S334 tag to retrieve the URL parameter value (you could have multiple URL parameters, and they could each specifically be targetted and retrieved through S334 tag. In this case, to pull the pagename value you will just use [[S334:pagename]]; Also you could integrate that S334 with S-tag if-else conditionalized content etc; while if you are using the first one, the way to pull your filename from the entire URL is to use Javascript and Regex -- which in this case not as simple/straightforward vs the above mentioned S334 tag. For example:

      var url = window.location.pathname;

      var filename = url.substring(url.lastIndexOf('/')+1);

      alert(filename);



      That will pull whatever after the last / meaning in your example it will be "Page_Name.html" -- but in actuality, URL often contains not just filename but also appended parameters (so you would need extra Regex to filter out those parameters starting from the "?" that indicates the location of your first parameter post filename.

    About the canonical. isn't it the way to make one as the canonical URL that what we would need to do is to create a <link> tag with the rel="canonical" attribute within the header (so this is likely going to be on your pagewrapper header area), similar to this. But anyway there is an interesting article I read at http://overit.com/blog/canonical-urls
    <link rel="canonical" href="http://secure.site.org/site/SPageServer?pagename=Page_Name" />



    regards,

    Daniel


    Jeffrey McCormack:

    So, a pagebuilder page URL can be two ways it seems:

    https://secure.site.org/site/SPageNavigator/Page_Name.html

    or

    https://secure.site.org/site/SPageServer?pagename=%2FPage_Name


    Google sees these are two separate pages with duplicate content and titles. Has anyone come up with and tested the the best way to create a canonical URL to say they are both the same? I would assume it to be something like:

    https://secure.site.org/site/SPageNavigator/[SOME S TAG TO GRAB PAGE NAME].html


    I am not quite sure how to use or properly format a S-tag to grab the relevant page name. Can anyone help with this?

Categories