How to implement Schema.org on HTTPS pages?
Asked Answered
M

3

10

Is it correct to statically set up Microdata’s itemtype attribute with HTTP value (http://schema.org/WebPage) on HTTPS pages or do I need to use HTTPS value (https://schema.org/WebPage) on all pages?

Since both HTTP and HTTPS versions of the site are available, can I set it up to //schema.org/WebPage or not?

Martian answered 24/11, 2014 at 10:50 Comment(0)
K
13

tl;dr: Use http URIs.

In this answer on Webmasters SE I explained why you should favor http over https Schema.org URIs: The http URIs seem to be canonical, as the actual definition of the Schema.org vocabulary only defines http, not https. In addition: all examples (even on HTTPS) use the HTTP variant, the authors mentioned that they prefer to see the use of the HTTP variant, and RDFa’s Initial Context defines the HTTP variant only (so most of the RDF world will use HTTP).

In this answer on Webmasters SE I explained why you should not use protocol-relative URIs for vocabularies: Vocabulary URIs typically don’t get dereferenced, and there will never get something embedded from a vocabulary, so there is absolutely no need to use HTTPS for these just because you use HTTPS (it’s similar to simply linking to an external page, which might not even be accessible via HTTPS). On top of that, your Schema.org markup would no longer work if the document is accessed via a different protocol than HTTP/HTTPS, and it’s likely that some parsers won’t be able to recognize that you are using the Schema.org vocabulary because they might look for full URIs without applying URI resolution for the itemtype attribute.

Kelsiekelso answered 24/11, 2014 at 19:8 Comment(3)
Thanks unor for the great reply :)Martian
W.T.H.? only 1 point score? I've been looking for an answer on this subject for about 30 minutes. Many thanks for the tips.Farlie
Is still correct? All schema.org documentation references http, but their source code sets https url's as canonicals. Is the written documentation just not updated to reflect the fact that https is preferred?Astrograph
M
5

There's been an update to that answer on Webmasters SE (dated November 2015), with a link to the schema.org FAQ about https:

Q: Should we write https://schema.org or http://schema.org in our markup?

The short of it is that schema.org will be moving to https, and you can use https URLs now, but there's no rush to switch.

Miley answered 14/10, 2016 at 22:25 Comment(0)
B
0

Regarding protocol-relative URLs… please don't use them as they're a hack. Favor use of absolute or root-relative URLs whenever hyperlinking documents on the Web.

Is it correct to statically set up Microdata’s itemtype attribute with HTTP value [...]?

Either HTTP or HTTPS is fine in your itemtype according to the Schema.org FAQ. Your examples containing HTTP and HTTPS schemes are both correct for pages served with and without TLS.

If you've got a mix of absolute URLs pointing to different schemes it's more likely a person will notice it and wonder why things aren't consistent. So when you update refactor your existing itemtypes.

Butz answered 10/3, 2019 at 8:1 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.