Redirect to https for WordPress

If your site already has an SSL certificate, you have most likely enabled automatic redirect from http to https in the Backlight 2 admin panel:

Automatically Redirect Browsers To https

Unfortunately, this redirect doesn’t work for WordPress based pages. But there is an easy fix for that. Just add following few lines at the beginning of your .htaccess file for your WordPress directory. For me, this file is in /blog.

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

Did you like this post? Did you use the given code? Please consider supporting me by buying me a coffee!

Buy Me A Coffee


Leave a Reply

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

Web Design Consulting

Do you need help designing your web site or getting Backlight working the way you want? Contact me to discuss your idea or project.

Buy me a Coffee

If you like what I share here, please consider buying me a coffee or a print. This helps keeping me motivated to continue posting. Thank you!

Buy Me A Coffee