SEMrush No redirect or canonical to HTTPS error for WordPress

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.

SEMrush HTTPS 301 redirect error

Here are the 2 scenarios in which you may have found yourself in, if you’re getting this SEMrush error:

  • you actually haven’t added a 301 redirect to your .htaccess file to redirect HTTP to HTTPS
  • you have added a redirect, but it isn’t a 301, and probably is a 302

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

Updated

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

Your email address will not be published. Required fields are marked *

©2024 First Planet

Studio
  • 2007 James St. 
    Burlington, ON, L7R 1H1
  • info@firstplanet.ca
  • 289-499-5934
Follow us