Redirect rules

Manually add .htaccess redirect

The Really Simple SSL plugin tries to insert the .htaccess redirect automatically, but in some cases either the testpage is blocked by security settings (so the plugin cannot determine which redirect code should be inserted), or the htaccess file is not writable.

Because you now do not have a 301 permanent redirect, this is not the best solution for seo. A 200 code is the result, which is not bad, as such, but is not perfect either.

You can do it manually of course. Open your ftp client, and navigate to your webroot. Find the .htaccess (make sure hidden files are shown).

Insert the following code at the top of your file:

Majority of websites:

RewriteCond %{HTTPS} !=on RewriteRule ^/?(.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]
In some cases you will need this instead:

RewriteEngine On
RewriteCond %{HTTP:X-Forwarded-Proto} =http
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]


Related Articles


  • Kumar

    I want to enable this for just one of domains in a multihosting server. How can I do it?

Leave a Comment