404 pages Redirect rules

Redirection to subfolder domains redirects to https://www.domain.com/domain.com

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

RewriteEngine on 
RewriteCond $1 !domain/ 
RewriteCond %{HTTP_HOST} ^domain.com$ [NC,OR] 
RewriteCond %{HTTP_HOST} ^www.domain.com$ 
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} ^domain.com [NC] 
RewriteRule ^(.*)$ https://www.domain.com/$1 [L,R=301]


Related Articles


  • Anan Mohammed

    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.

    • Rogier Lankhorst

      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.

  • Laura Liebel

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

    WP – launchny.org/lny
    Main – launchny.org

    How do I fix this?

    • Mark Wolters

      Hi Laura,

      It seems to be working fine now, do you still experience issues? If so, when do you experience these issues?

      • Laura Liebel

        Just deleted all history in chrome. Seems ok now. thanks.

Leave a Comment