Helo! 我想爲將來使用mod_rewrite創建的所有子域準備一個動態虛擬主機。所有的子域名將以相同的方式配置,所以我想使用動態VH配置。 我希望每個子域的文檔根目錄都是/ home/user/public_html/subdomainName。動態配置的虛擬主機
我試着用下面的配置,但沒有成功:
<VirtualHost xxx.xxx.xxx.xxx:80>
# get the server name from the Host: header
UseCanonicalName Off
<Directory /home/user/public_html/>
# ExecCGI is needed here because we can't force
# CGI execution in the way that ScriptAlias does
Options FollowSymLinks ExecCGI
</Directory>
RewriteEngine On
# a ServerName derived from a Host: header may be any case at all
RewriteMap lowercase int:tolower
#rule that is suposed to set document root of virtual host!???
RewriteRule ^([a-z-]+)\.domain\.com/?(.*) /home/user/public_html/$1/$2
</VirtualHost>
規則或somethinh似乎是錯的andit不適用。我從來沒有使用動態VH合作過,所以我不知道在哪裏我錯了......
這個問題更適合serverfault.com – thkala 2011-01-08 18:09:37