URL without www redirect directly with submission page – Multiwordpress install

Since you have multiple domains you can’t include the domain in the redirect itself to create a one-size-fits-all generic redirect (which is what I assume you are trying to do). You also need to ensure that the directives are in the correct order.

Since all your sites use the www subdomain then try the following instead. However, this assumes you don’t have any other subdomains.

RewriteEngine On

# non-www to www (and HTTPS)
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule (.*) https://www.%{HTTP_HOST}/$1 [R=301,L]

# HTTP to HTTPS 
RewriteCond %{HTTPS} !=on
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

# WordPress directives follow...

The non-www to www redirect now tests if the requested host does not start www. And if not, simply prepends it.

No need to repeat the RewriteEngine directive and no need for the <IfModule mod_rewrite.c> wrappers on your custom directives.

With regards to your HTTP to HTTPS redirect, there’s no need to capture the RewriteRule pattern if it is not being used in the substitution. ie. When using %{REQUEST_URI} instead of a backreference.

As always, clear your browser cache before testing.

error code: 523