【发布时间】:2013-04-23 08:39:19
【问题描述】:
我有特定的重写,比如
RewriteEngine On
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
RewriteRule .* /app_dev.php
我需要像 hello.epsilon.localhost 和 example.epsilon.localhost 这样的域名将转到 epsilon.localhost 虚拟主机(抱歉我的英语不好)
epsilon.localhost 的完整虚拟主机
<VirtualHost *:80>
DocumentRoot "C:/Projects/epsilon/web"
RewriteEngine On
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
RewriteRule .* /app_dev.php
<Directory "C:/Projects/epsilon/web">
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
ServerName epsilon.localhost
</VirtualHost>
对 symfony 2.1 的重写
【问题讨论】:
-
将
ServerAlias添加到VirtualHost配置并将域和子域添加到hosts文件(system32\hosts)。 -
我添加了 127.0.0.1 *.epsilon.localhost
-
和 ServerAlias *.epsilon.localhost 但我需要第三级名称是动态的,但它不起作用
-
添加规则到
.htaccess文件,如果HTTP_HOST不等于epsilon.localhost重写为epsilon.localhost。