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]


Lightweight plugin, Heavyweight Security features. Get Pro and leverage your SSL certificate for WordPress security standards.