根目录

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
# “web”为目录名
RewriteCond %{REQUEST_URI} !^/web/.*
RewriteCond %{HTTP_HOST} ^zhaiyanchao.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.zhaiyanchao.com$
RewriteRule ^(.*) /web/$1 [L]
</IfModule>

目标页

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /www.zhaiyanchao.com/
</IfModule>