例如:将输入 www.texiaoyao.cn 的域名时跳转到texiaoyao.cn
1
2
3
4
5
6
7
8
9
10
11
12<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www.texiaoyao.cn [NC]
RewriteRule ^(.*) http://texiaoyao.cn/ [L]
//如果还有重写的话,记得要添加RewriteCond.否则会报错
RewriteCond %{HTTP_HOST} ^texiaoyao.cn$
RewriteRule ^(/)?$ web/index.php [L]
</IfModule>