我在httpd.conf
<VirtualHost *:80>
ServerName www.mydomain.com
RewriteEngine on
RewriteRule ^/(.*) http://www.anotherdomain.uk.com/ [L,R=302]
</VirtualHost>
我希望安排这样做,以便在输入www.mydomain.com/admin
时我不会被重定向。
答案 0 :(得分:5)
<VirtualHost *:80>
ServerName www.mydomain.com
RewriteEngine on
RewriteCond %{REQUEST_URI} !^/admin
RewriteRule ^/(.*) http://www.anotherdomain.uk.com/ [L,R=302]
</VirtualHost>