我在Ubuntu上运行Apache 2,并希望将一个子域上的所有请求转发到另一个子域。
例:
a.example.com/page.html将转发给b.example.com/page.html
我想转发所有请求(不只是几页)。
我将如何在虚拟主机中设置?
RewriteEngine on RewriteCond %{HTTP_HOST} ^a\.example\.com RewriteRule ^(.*)$ http://b.example.com/$1
我真的不知道为什么每个人总是试图用mod_rewrite而不是mod_alias来解决这些redirect问题。
a.example.com的容器中:
RedirectPermanent / http://b.example.com/