문제

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