Question

I recently started loading stylesheets on my webpages using just // instead of fighting between http:// and https://. E.g.:

<link href="//example.com/styles.css" rel="stylesheet" type="text/css" />

Now I wonder if the same should be done for the link[rel="canonical"] tags. E.g.:

<link rel="canonical" href="//example.com/index.html" />
Was it helpful?

Solution

If you do it, the purpose of rel="canonical" is somewhat defeated, as the page now has two names (one for http:, one for https:). There's nothing prohibiting it, but it's probably not a good idea.

Pick one or the other and make that the canonical URL.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top