Answer the question
In order to leave comments, you need to log in
The canonical tag for the https and http versions of the site, how would it be correct?
There was a domin.com
domain with:
<link rel="canonical" href="http://domain.com/" />
<link rel="alternate" media="only screen and (max-width: 640px)" href="http://m.domain.com/" />
<link rel="alternate" media="handheld" href="http://m.domian.com/" />
<link rel="canonical" href="http://domain.com/" />
Answer the question
In order to leave comments, you need to log in
Try not specifying the protocol at all by changing to relative paths:
<link rel="canonical" href="//domain.com/" />
<link rel="alternate" media="only screen and (max-width: 640px)" href="//m.domain.com/" />
<link rel="alternate" media="handheld" href="//m.domian.com/" />
RewriteEngine On
RewriteCond %{SERVER_PORT} !^443$
RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]
Just don't force an unconditional redirect to HTTPS. The correct way is HTTP Strict Transport Security and redirects in case Upgrade-Insecure-Requests is specified .
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question