設置 apache 轉發規則時的問題
剛才一客戶要求對域名設置兩個別名,我作了如下設置:
RewriteRule ^/(.*)$ http://localhost:8080/VirtualHostBase/http/%{SERVER_NAME}:80/cheuknang.com/cheuknang.com/VirtualHostRoot/$1
RewriteRule ^webmail$ http://webmail.localhost.com/webmail/$1
RewriteRule ^cgi-bin2$ http://webmail.localhost.com/cgi-bin2/$1
問題是,第一行的規則將下面兩行的設置覆蓋掉了,應該怎麼改?
《解決方案》
自己解決了,調整了下順序:
RewriteRule ^/webmail http://webmail.localhost.com/webmail/
RewriteRule ^/cgi-bin2 http://webmail.localhost.com/cgi-bin2/
RewriteRule ^/(.*) http://localhost:8080/VirtualHostBase/http/%{SERVER_NAME}:80/cheuknang.com/cheuknang.com/VirtualHostRoot/$1