On Wed, Jan 19, 2011 at 10:24 AM, Chad Sollis <[email protected]> wrote:
> sorry for not being totally clear.  What I want it to do is actually anything 
> without a subdomain, to redirect to www.domain.com  if it has a subdomain, it 
> will be ignored.  Good catch on the QSA.

Ah, ok, so I think this should work instead:

RewriteCond %{HTTPS} =off
RewriteCond %{HTTP_HOST} ^([^\.]+\.[^\.]+)$ [NC]
RewriteRule ^(.*)$ http://www.%1/$1 [L,R=301,QSA]
RewriteCond %{HTTPS} =on
RewriteCond %{HTTP_HOST} ^([^\.]+\.[^\.]+)$ [NC]
RewriteRule ^(.*)$ https://www.%1/$1 [L,R=301,QSA]

Regards,
Bryan Petty

_______________________________________________

UPHPU mailing list
[email protected]
http://uphpu.org/mailman/listinfo/uphpu
IRC: #uphpu on irc.freenode.net

Reply via email to