.htaccess - htaccess direct domain and subdomain? -


I have a problem from where I want to redirect <301 permanent] to all traffic [<301 permanent]

  www.example.com - & gt; Www.website2.com blog.example.com - & gt; Blog.example.com  

Then redirect website / subdomain to website 2.com on "example.com" for blog on example.com? How to make a little uncertain about using .htaccess on "example.com"?

Really appreciate any help.

something similar:

  rewrite% {HTTP_HOST}! (^ Blog \ .example \ .com $) The Rewrite Rule (. *) Http://www.website2.com/$1 [R = Permanent, QSA, L]  

Line Line :

If the host: header ("% {HTTP_HOST}" is not "!") blog.example.com (no other string matching with regex), execute the following rewrite:

Any matching pattern (". *", That is, for any URL), www.website2 Redirect to com on the same path (as if it will be redirected).


Comments