I'm using the following htaccess do redirect people who not have the "www" or "staging" subdomain in the url to the www.domain.com subdomain
RewriteCond %{HTTP_HOST} !^(www.domain.com|staging.domain.com)$ [NC]
RewriteRule ^(.*)$ http://www.domain.com/$1 [L,R=301]
Now I'd like to have the same generic for multiple domains. However the following isn't working:
RewriteCond %{HTTP_HOST} !^((www|staging|dev).(^\.*).(de|lo))$ [NC]
RewriteRule ^(.*)$ http://www.$2.de/$4 [L,R=301]
Returns in an configuration error.
Thx I appreciate your help!