Apache三级域名配置

时间:2013-04-23 08:39:19

标签: apache symfony rewrite

我有特定的重写,如

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的重写

1 个答案:

答案 0 :(得分:0)

我在Windows上使用此http://sourceforge.net/projects/acrylic/作为本地DNS服务器 这在虚拟主机配置中

<VirtualHost 127.0.0.1>
ServerName devsite.localhost
ServerAlias *.devsite.localhost

DocumentRoot "C:/httpdocs/devsite"
</VirtualHost>