Really Simple SSL

Redirection to subfolder domains redirects to

If you are running multiple single-site WordPress websites in one hosting account, where you redirect to the correct domain using htaccess code like in this example:

RewriteEngine on 
RewriteCond $1 !domain/ 
RewriteCond %{HTTP_HOST} ^$ [NC,OR] 
RewriteCond %{HTTP_HOST} ^$ 
RewriteRule (.*) /domain/$1 [L]

The default Really Simple SSL redirect in combination with this code might cause a redirect that ends up like this:

To solve this, you have to add some lines to the .htaccess in your root folder. The root folder then is the folder where all folders are located with the subsites in it. It probably looks something like this:

  • root folder, with root .htaccess
    • domain1
    • domain2
RewriteCond %{HTTP_HOST} ^ [NC] 
RewriteRule ^(.*)$$1 [L,R=301]




Related articles

8 Responses

  1. look at the default Really Simple SSL lines where exactly? I am having this same problem but the instructions to solve it doesn’t seem to be very clear.

    1. I’ve updated the article, so you don’t need these lines. Could you check if the current article is more clear? You should add those lines to the .htaccess folder in your root folder, where all subfolders/sumdomains are located.

  2. WordPress site is a subdomain. The home page of the subdomain is redirecting to the main domain.

    WP –
    Main –

    How do I fix this?

  3. Hi, my issue is not exactly this one,l but it’s the one that seems the closest.

    I have multiple WordPress sites on my single hosting. I installed ReallySimpleSSL in one of these sites. Works fine (access through https is secured and all) but I have problems with the redirect. The subdirectory site htaccess looks like this atm:

    # BEGIN rlrssslReallySimpleSSL rsssl_version[3.2.5]

    RewriteEngine on
    RewriteCond %{HTTPS} !=on [NC]
    RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]

    # END rlrssslReallySimpleSSL
    # BEGIN WordPress

    RewriteEngine On
    RewriteBase /planetamagicsantcugat/
    RewriteRule ^index\.php$ – [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /planetamagicsantcugat/index.php [L]

    # END WordPress

    And the htaccess on the root of my hosting looks like this:

    RewriteEngine On
    RewriteBase /
    RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
    RewriteRule ^(.*)$ http://%1/$1 [R=301,L]

    Atm there is nothing on my root (no WP site or anything, might be in the future).

    The problem is:
    https:/ works fine.
    http:/ redirects to https:/

    I am guessing I am missing something on my root htaccess. What is the best practice here to fix it?


    1. Hi,

      is there a difference in redirect when using http:// and http://www? What you could try is editing the following line in your subdirectories .htaccess file:

      RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]

      to this:

      RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

      The {REQUEST_URI} parameter is slightly different from the %1 and might solve this issue. You could try the same for the RewriteRule ^(.*)$ http://%1/$1 [R=301,L] line, changing it to RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] as well.


Leave a Reply