Symfony 2子域问题


Symfony 2 problems with subdomain

我想我对htaccess有问题。

我有一个子域,它重定向到一个文件夹,如subdomain.domain.com --> home/subdomain

问题是,如果我写subdomain.domain.com没有重定向到app.php,如果我编写子域.domain.com/app.php,它就可以工作。

另一方面,如果我写domain.com/subdomain/web(假设这是到应用程序的路由),就不需要写app.php。

因此,它同时适用于以下两种情况:domain.com/subdomain/web/ and domain.com/subdomain/web/app.php

我有以下htaccess:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ app.php [QSA,L]
</IfModule>

我不知道htaccess

PS:我不知道这个问题是否已经被理解,我想在写subdomain/domain.com 时直接访问subdomain.domain.com/app.php

RewriteEngine on 
RewriteCond %{HTTP_HOST} ^(.*)'.mydomain'.com$
RewriteCond %{HTTP_HOST} !^www'.mydomain'.com$
RewriteRule (.*) http://mydomain.com/%1$1 

检查此项:http://www.sitepoint.com/getting-started-apache-mod_rewrite-methods/并搜索"子域"