Forum Moderators: phranque
RewriteCond %{HTTP_HOST} ^mysite.org [NC]
RewriteRule ^(.*)$ http://www.mysite.org/$1 [L,R=301] RewriteCond %{HTTP_HOST} ^t.mysite$ [NC]
RewriteRule (.*) http://www.mysite.org/$1 [R=301,L] RewriteCond %{HTTP_HOST} !^mysite\.org$ [NC]
RewriteCond %{HTTP_HOST} !^(valid1|valid2|valid3)\mysite\.org$
RewriteRule ^ http://www.mysite.org%{REQUEST_URI} [R=301,L,NE]
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^www\.
RewriteRule ^ http://www.mysite.org%{REQUEST_URI} [R=301,L,NE]
RewriteCond %{HTTP_HOST} ^mysite.org [NC]
RewriteRule ^(.*)$ http://www.mysite.org/$1 [L,R=301]
RewriteCond %{HTTPS} on [OR]
RewriteCond %{HTTP_HOST} !^((www|valid1|valid2|valid3)\.example\.org)?$ [NC]
RewriteRule (.*) http://www.example.org/$1 [R=301,L] it appeared that the subdomain should existWell, there are different levels of existence.* It has to “exist” in the sense that there has to be a DNS that points requests to some location where they will meet your htaccess file. This part might be either wild-card subdomains or something more specific, depending on your setup. But it doesn’t have to “exist” in the sense of having any physical files on your server.