I have a problem where I want to redirect all traffic [301 permanent] from
www.example.com --> www.website2.com
blog.example.com --> blog.example.com
So redirect all domains/subdomains on “Example.com” to website2.com EXCEPT for the blog on example.com ? Little unsure how to set this up using .htaccess on “example.com” ?
Really appreciate any help.
Somewhat similar to this question:
Line by line:
In case the
Host:header (“%{HTTP_HOST}”) is not (“!”)blog.example.com(no other string matches that regex), execute the following rewrite:for a pattern matching anything (“.*”, that is, for any URL), redirect to the same path on http://www.website2.com (e.g. http://blahblah.example.com/somepath will get redirected to http://www.website2.com/somepath ).