HTTPS for WordPress websites by .htaccess

In this article we will learn how to HTTPS for WordPress websites by .htaccess.

The method to make your WordPress based website to run always on https.

1. Login into wp-admin and go to “Settings -> General”. Make sure the URL have https.

2. From the file manager, edit your .htaccess and replace the WordPress rules by the following code:

# BEGIN WordPress

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]

# Rewrite HTTP to HTTPS
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$$1 [R=301,L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

# END WordPress

Note: Replace by your domain name. Make sure the position of the https Rewrite rule is same as mentioned above.

And it’s done!

In this article we have seen how are support engineer force HTTPS for WordPress websites by .htaccess.

[Need assistance to fix this error or install tools? We’ll help you.]

Related Articles