Forum Moderators: phranque

Message Too Old, No Replies

schema, https:// or just //

         

csdude55

9:51 pm on Mar 15, 2020 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I'm in the middle of changing all of my [schema.org...] links to https, and it hit me...

Can I just change them to //schema.org and leave off the http?

Their FAQs aren't clear on this:

[schema.org...]

not2easy

11:05 pm on Mar 15, 2020 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Have you tried the Google tool for testing schema to see what it shows with // - I haven't tried, but it may work?
[search.google.com...]

lammert

11:07 pm on Mar 15, 2020 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



This is not defined in the schema.org definition but in the RFCs which define the parsing of URLs. The first RFC which defines relative URL parsing is RFC 1808 [tools.ietf.org] from 1995. According to section 4, step 2.c, if the scheme (http or https keyword) is not present, the base scheme must be used.

lucy24

11:09 pm on Mar 15, 2020 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Can I just change them to //schema.org and leave off the http?
Wouldn’t that be interpreted as linking to /example.com/schema.org (i.e. a nonexistent location on your own site)?

I think what they’re saying is that nothing will break if you don’t rush out and change http: to https: But, yeah, “There is a general trend towards using 'https' more widely” is a very weird way of conveying information about how best to link to the site that is carrying the FAQ. It makes it sounds as if they don’t really understand what “https” means--which cannot possibly be the case.

:: wandering off to check the only page I can think of that uses schema markup at all ::

csdude55

11:26 pm on Mar 15, 2020 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Good point, @not2easy, it didn't cross my mind to use the tool! I can safely say that using //schema.org does NOT give any errors or warnings :-)

Wouldn’t that be interpreted as linking to /example.com/schema.org (i.e. a nonexistent location on your own site)?

It's my understanding that linking to "//foo.com" would inherently assume the same protocol as the page that's loading it. So if I'm on http://www.example.com and link to "//schema.org" then it should assume "http", but if I'm on https://www.example.com then it should assume "https".

I changed my links to Google scripts to "//" instead of "https://" awhile back, and everything seems fine with no errors and no performance shift. But I thought it might save a few bytes of data, and possibly save me from any potential warnings down the road.

phranque

11:49 pm on Mar 15, 2020 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Can I just change them to //schema.org and leave off the http?

that would be a protocol-relative url and lammert's reference is the relevant document

csdude55

12:16 am on Mar 16, 2020 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I don't disagree, it just didn't specify anything about schema.org. And since I'm not quite sure how it works, I wasn't sure if it was relevant.

The best I can tell, when you define the schema there's no actual HTTP request to schema.org. I'm not sure what the actual value IS, but if there's no HTTP request then does it follow the same protocol-relative rules? Would Google recognize it appropriately?

not2easy's link seems to imply so, but it's just an educated guess on my end.