Conditional URL rewriting
How can I use URL rewriting in .htaccess to redirect to different domains depending on the URL?
Examples:
http://ON开发者_Go百科E/
tohttp://TWO/
http://ONE/some_content
tohttp://THREE/some_content
This ought to work if you want to redirect the client:
# http://ONE/ to http://TWO/
RewriteCond %{HTTP_HOST} =one
RewriteRule ^$ http://two/ [R,L]
# http://ONE/some_content to http://THREE/some_content
RewriteCond %{HTTP_HOST} =one
RewriteRule ^(.+)$ http://three/$1 [R,L]
If you prefer to proxy the requests, change the R flag to a P instead.
精彩评论