apache htaccess文件跳转的例子

Options +FollowSymlinks
RewriteEngine on

# 301 跳转
RewriteCond %{HTTP_HOST} ^(www.)?wangyiqiu.com$
RewriteRule ^(.*)$ http://wangyiqiu.a8z8.com/$1 [L,R=301]

# 正常的配置
RewriteCond %{HTTP_HOST} ^(www\.)?zhaosandao\.(com|cn)$
RewriteCond %{REQUEST_URI} !^/zhaosandao/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /zhaosandao/$1
RewriteCond %{HTTP_HOST} ^(www\.)?zhaosandao\.(com|cn)$
RewriteRule ^(/)?$ zhaosandao/index.html [L]