有没有办法使位于不同于DocumentRoot路径的文件的重写规则?说我有域http://test.ldt/与DocumentRoot /home/test_ltd/,我想当一个文件被请求在静态。子域(http://stats.test.ldt/)它会查找从另一个路径请求的文件,说/ home/static_files/httpd重写规则与不同的DocumentRoot目录
我被建议使用mod_alias。但是,我不确定如何在需要子域名时使其工作。
to cristis:
你是不对的。例如,如果这些将是我的httpd的规则:
ServerName domain.ltd
ServerAlias www.domain.ltd
DocumentRoot /home/domain_ltd
RewriteEngine on
RewriteCond %{HTTP_HOST} static2.domain.ltd
RewriteRule (.*)$ /home/static_files/$1 [L]
DirectoryIndex index.html index.htm index.php
和客户端将请求static2.domain.ltd/foo.txt,该文件将在/ home搜索/ domain_ltd /家庭/ static_files/$ 1
你有访问'httpd.conf',还是仅限于使用'.htaccess'文件? – 2010-06-28 20:21:37
我有权访问httpd.conf – Gajus 2010-06-28 20:29:34