【发布时间】:2010-04-22 19:38:24
【问题描述】:
我在一个帐户上托管多个域,并且我目前设置了一个 RewriteRule 以将根 URL (www.root.com) 重定向到子目录 (/public_html/root/)。
但是,我想从根 url (www.root.com/xyz) 访问根 (/public_html/xyz/) 中的几个目录。是否可以为此编写重定向,或者我必须将这些文件夹放在 /public_html/root/ 目录中?
这就是我的 .htaccess
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www.)?root.com$
RewriteCond %{REQUEST_URI} !^/root/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{HTTP_HOST} ^(www.)?root.com$
RewriteRule ^(/)?$ root/index.php [L]
提前致谢!
【问题讨论】:
-
投票结束:这个问题很好。见meta.stackexchange.com/questions/39063/…
标签: .htaccess