Posted Thursday, January 11th, 2018 - 7,329 views
Are you getting the error in SEMrush as follows? “No redirect or canonical to HTTPS homepage from HTTP version”. Well, you’re not alone, and you’re in luck.
Here are the 2 scenarios in which you may have found yourself in, if you’re getting this SEMrush error:
Solving the problem will most likely lie in using the right code. Here is what I found that worked. Remember if you’re using WordPress, to add the following code snippet above # BEGIN WordPress, and make sure to change “domain” to your domain, and the .com to your TLD.
# BEGIN SSL Options +FollowSymLinks RewriteEngine On RewriteCond %{HTTPS} !=on RewriteCond %{HTTP_USER_AGENT} ^(.+)$ RewriteCond %{SERVER_NAME} ^domain\.com$ RewriteRule .* https://www.%{SERVER_NAME}%{REQUEST_URI} [R=301,L] Header add Strict-Transport-Security "max-age=300" # END SSL
Or an even more efficient block of code:
# BEGIN SSL RewriteEngine On RewriteCond %{HTTP_HOST} domain\.ca [NC] RewriteCond %{SERVER_PORT} 80 RewriteRule ^(.*)$ https://www.domain.ca/$1 [R,L] # END SSL
Save your changes, and run SEMrush’s site audit tool again and you should see that this particular error should disappear.
I’m giving a special thank you to SEMRush for their customer support and actually checking the site’s response code and sending it to me. They practically solved the problem. All I needed to do was find the right code.
Leave a Reply