How to Force 301 WordPress Redirects when Switching from HTTP to HTTPS

Switching your WordPress site from HTTP to HTTPS by installing an SSL certificate can seem daunting. Once you follow the instructions, it isn’t so bad. One frustration I encountered after installing many SSL certificates using WordPress was the 302 redirect it defaults to when forcing an HTTPS in .htaccess. I couldn’t find the right code until I stumbled upon the right trick.

Place this .htaccess code at the very top line of the file in order to force WordPress to 301 redirect to HTTPS:


RewriteEngine on
RewriteCond %{HTTPS} !=on [NC]
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

Need an SEO Consultant for your Local Business in Chicago? Contact me today for a free initial SEO consultation for local business owners in Chicago and Chicagoland area.
or
Download my 2016 SEO Best Practices Guide for some free tips!

No Comments - Leave a comment

Leave a Reply

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

*