RewriteEngine on //必须打开才能用
RewriteRule ^/?(test.php)$ /index.html [R,L] //将test.php重定向到index.html
rewriterule ^/?(test.php)$ /index.html?id=$1 [R,L] //将重定向的url加上参数
rewritecond %{REMOTE_HOST} !^127.0.0.2
RewriteRule ^index/.html$ /test.php [R,L] //是127.0.0.2访问才转向test.php
rewritecond %{HTTP_HOST} ^www.test.com$
RewriteRule ^index/.html$ /test.php [R,L] //是www.test.com才转向test.php
rewritecond %{HTTP_HOST} ^www.test.com$
rewritecond %{HTTP_USER_AGENT} !^Mozilla.* [NC] //不是Mozilla开头的客户端
RewriteRule ^index/.html$ /test.php [R,L] //双条件,使用R会使url外部重定向,也就
是浏览器的地址会变化,不使用R则不会变化