After your SSL certificate is installed on your Linux Hosting account, there are some modifications you'll need to make to your .htaccess file to automatically redirect your visitors to an HTTPS version of your WordPress website.
# BEGIN SSL
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_USER_AGENT} ^(.+)$
RewriteCond %{SERVER_NAME} ^coolexample\.com$ [OR]
RewriteCond %{SERVER_NAME} ^www\.coolexample\.com$
RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]
Header add Strict-Transport-Security "max-age=300"
</IfModule>
# END SSL
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
Article ID: 879
Created On: Wed, Jun 3, 2020 at 10:40 PM
Last Updated On: Wed, Jun 3, 2020 at 10:40 PM
Online URL: https://www.heartinternet.uk/support/article/redirect-my-wordpress-website-to-https-for-linux-hosting.html