• Anonymous User 14132313

    (@anonymized-14132313)


    Hi. I was running All in One SEO Pack 2.2.2 on a domain that was temporarily available via HTTP and HTTPS. Originally, WordPress had been set up via HTTP, so I expected the rel=canonical URLs to use the HTTP address. But when I looked at the HTML source code I noticed that All in One SEO Pack used HTTP for the canonical URL when accessing a page via HTTP and used HTTPS when accessing the same page via HTTPS. So, All in One SEO Pack returned two different rel=canonical URLs for the same page, which is contrary to what rel=canonical is supposed to do.

    https://www.ads-software.com/plugins/all-in-one-seo-pack/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi Per Leb?r,

    This is how WordPress handles protocols; it’s (probably) not two different pages at all, it’s the same page accessed using a different protocol (http vs. https).

    I should note that what makes this more confusing though, is that it is possible to have the https port connecting to the same domain access a different web server or path, so there actually is no guarantee that connecting to https would return the same resource or page as connecting to http. Changing this is technically a “normalization that changes semantics”, which we try to avoid doing gratuitously. That said, you can change this behavior if you like, by using the aioseop_canonical_url filter.

    Thread Starter Anonymous User 14132313

    (@anonymized-14132313)

    Hi Peter Baylies,

    > it’s (probably) not two different pages at all, it’s the same page
    > accessed using a different protocol (http vs. https)

    Indeed, it’s the same page accessed using different protocols and different URLs (obviously, because the protocol name is used as URI scheme in HTTP/HTTPS URLs). And that’s fine; there’s nothing wrong about that.

    However, search engines do not want to index the same page twice for different URLs. They do not want duplicate content in their search results. So search engines have invented the rel=canonical link to enable web authors to define their preferred URL for a page. The sole purpose and semantics of rel=canoncial is to provide a single preferred URL for the same content at different access URLs.

    Note that Google gives the HTTP/HTTPS scenario as an example of when to provide a single preferred URL using rel=canonical: https://support.google.com/webmasters/answer/139066?hl=en

    So All in One SEO Pack’s behavior of displaying different canonical URLs for the same content is clearly wrong, isn’t it?

    It’s nice to know that I can change that behavior, but why would you want to keep a broken feature?

    Hi Per Leb?r,

    As I’ve already explained, that’s not a safe assumption that our plugin can make, as it assumes something that may not be true about a site; it’s a good suggestion for a feature, though; I’ll look into this and see if it makes sense to add another option that would allow you to indicate that the content is the same across http and https, and specify which one is preferred, if any.

    Thread Starter Anonymous User 14132313

    (@anonymized-14132313)

    Hi Peter Baylies,

    > that’s not a safe assumption that our plugin can make, as it assumes
    > something that may not be true about a site

    But do you have to make this assumption? I’d suggest to check whether you can use the home option in the options table of the WordPress database. It includes an URI scheme and it seems reasonable to me to take this one as preferred scheme.

    Otherwise, adding an option for the author to indicate the preferred URL would be great.

    If none of these possibilities turned out to be practical, I’d suggest to drop the rel=canonical link from the plugin, as I think that having it wrong hurts more than having none. I’d also like to add that search engines can do normalizations that preserve sematics as defined at Wikipedia automatically. Only where the semantics change and an external client such as a search engine can not rely on save automatic normalization rules, rel=canonical gets really interesting as indicator for the preferred URL of duplicate content.

    HI Per Leb?r,

    If you look at how this works in the plugin, we essentially do make the same assumptions that WordPress makes already. That said, you are also free to disable canonical urls in the plugin. What might seem like a reasonable assumption to you often does not end up working in practice depending on how people actually have their sites configured. Therefore, I’ll see if I can add an option to allow the user to indicate this.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘bug: different rel=canonical URLs for the same page’ is closed to new replies.