incrediBILL

msg:4450454 | 6:20 pm on May 7, 2012 (gmt 0) |
I would think changing from RewriteCond %{HTTP_HOST} !^(www\.example\.com)?$ to RewriteCond %{HTTP_HOST} ^(example\.com)?$ Would do the trick
|
alhermette

msg:4450483 | 7:59 pm on May 7, 2012 (gmt 0) |
Thank you, that did the trick.
|
lucy24

msg:4450617 | 2:16 am on May 8, 2012 (gmt 0) |
Most specific to most general. Start with anything that applies to the subdomain, get it out of the way and then carry on as usual with the primary domain. What if your requested host is example.com:80 or the like?
|
g1smd

msg:4450692 | 6:42 am on May 8, 2012 (gmt 0) |
There was a reason that the pattern was !^(www\.example\.com)?$ which is now negated by using something else. Use this:
RewriteCond %{HTTP_HOST} !^(www\.example\.com)?$ RewriteCond %{HTTP_HOST} !^subdomain\. RewriteRule (.*) http://www.example.com/$1 [R=301,L]
|
|