How to Redirect WordPress from HTTP to HTTPS
To redirect your WordPress website to the secure HTTPS protocol on Linux, there are several steps that need to be taken before the redirect will work properly.
Log in to WordPress
First, you need to visit Settings then click on a general page.

Then update your WordPress and site URL address fields by replacing http with https.

Next step, you need to set up WordPress redirects from HTTP to HTTPS by adding the following code to your .htaccess file.
1 |
1 2 3 4 5 |
<IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{HTTPS} off RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] </IfModule> |