Quantcast
Channel: Altschuler
Viewing all articles
Browse latest Browse all 60

How to edit the .htaccess file to redirect from HTTP to HTTPS for WordPress sites using SSL

$
0
0

In the .htaccess file found in the root folder of your WordPress site, add the following lines:

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

Make sure to add them before the line that says # BEGIN WordPress. WordPress will remove any lines that you add in between the lines # BEGIN WordPress and # END WordPress when you flush the permalinks. So for example, your complete .htaccess file should look something like this:

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

# 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

 


Viewing all articles
Browse latest Browse all 60

Trending Articles