3

If a secure HTTPS page has a canonical tag referencing the HTTP version, will this cause the message in the browser that the page is using unsecure elements and prevent the green lock icon appearing?

e.g

https://wwww.example.com/

has the following canonical tag defined:

<link rel="canonical" href="http://wwww.example.com/" />

I know if that if other elements on a HTTPS page are called unsecured via HTTP you get the following warning in browsers:

enter image description here

As opposed to the lock icon:

enter image description here

Will this also happen if the canonical tag is using HTTP? I've read else where that it wont, but I'd like to see a live example.

1

2 Answers 2

8

Web browsers do not care about canonical URLs. It is for search engine use only (specifically Google).

Additionally, canonical URLs do not affect the loading or rendering of a web page. So no assets will be loaded over HTTP which is what would cause an insecure error message.

So, no, they will not display any error message.

3
  • Do you have an example? Even though its within a canonical tag, there is still http being referenced within the page code. So makes me think it may still see the http.
    – Max
    Commented Jul 17, 2014 at 1:58
  • Seeing and being pertinent are two different things. HTML tags have purpose. This tag's purpose are of no concern to browsers (just like meta tags).
    – John Conde
    Commented Jul 17, 2014 at 2:02
  • 1
    The key here is to understand what canonical links are intended for, as specified in RFC 6596: The canonical link relation specifies the preferred IRI from resources with duplicative content, and only references its usage in relationship to applications such as search engines.
    – dan
    Commented Jul 17, 2014 at 3:29
3

It shouldn't. The unsecure warning comes about when a secured page incorporates non-secured elements. A canonical tag is a link, not an object to be incorporated into the page, so there's no reason why the padlock should care whether the URL it points to is http or https.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.