Вопрос

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" />
Это было полезно?

Решение

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.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top