Apache三级域名配置

Apache三级域名配置,apache,symfony,rewrite,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>

我有具体的重写,比如

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的重写,我将其用作windows上的本地DNS服务器 这是在虚拟主机配置中实现的

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

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

将ServerAlias添加到VirtualHost配置中,并将域和子域添加到hosts文件system32\hosts中。我已经添加了127.0.0.1*.epsilon.localhost和ServerAlias*.epsilon.localhost,但我需要三级名称是动态的,但它不适用于将规则添加到.htaccess文件中,前提是HTTP_HOST不等于epsilon.localhost重写为epsilon.localhost。