我在一家拥有多个域名的托管提供商的共享帐户中工作。目标是让每个域名都有自己的虚拟目录。在我的个人电脑里
htdocs/
目录,我为每个域名设置了一个子目录,类似于:
htdocs/
foo.com/
index.html
bar.com/
test.txt
我要上菜
http://foo.com/index.html
而不是
http://foo.com/foo.com/index.html
.
这是正确的设置方式吗
.htaccess
在里面
htdocs/
?
RewriteEngine on
RewriteCond %{HTTP_HOST} .*foo\.com [NC]
RewriteRule ^/(.*)$ /foo.com/$1 [L]