主程序在www.a.com
某个子程序在www.a.com/b.php
现在想把b.a.com绑定到www.a.com/b.php,即:
外部访问www.a.com/b.php则跳转到b.a.com
外部访问b.a.com则内部代理为www.a.com/b.php
我只知道下面是不行的,会造成循环导致不断redirect:
RewriteCond %{HTTP_HOST} ^(www\.a\.com)(:80)? [NC]
RewriteRule ^b\.php(.*)$
http://b.a.com/$1 [L,QSA]
RewriteCond %{HTTP_HOST} ^(b\.a\.com)(:80)? [NC]
RewriteRule ^(.*)$
http://www.a.com/b.php$1 [L,QSA,P]