如何将子域指向特定的包?

时间:2013-10-01 18:45:47

标签: php symfony routing virtualhost symfony-routing

如何将子域指向特定的包。我有vhost

<VirtualHost *:80>
    ServerName subdomain1.mysite.dev
    ServerAlias subdomain2.mysite.dev

    DocumentRoot /mysite/web
    <Directory /mysite/web>
        AllowOverride All
        Order allow,deny
        Allow from All
    </Directory>

</VirtualHost>

/etc/hosts

127.0.0.1       subdomain1.mysite.dev subdomain2.mysite.dev

这是app/routing.yml

subdomain1:
    resource: "@ProjectSubdomain1Bundle/Resources/config/routing.yml"
    host: subdomain1.mysite.dev

subdomain2:
    resource: "@ProjectSubdomain2Bundle/Resources/config/routing.yml"
    host: subdomain2.mysite.dev

这样两个子域都会转到Subdomain1Bundle

1 个答案:

答案 0 :(得分:0)

对不起,我很惭愧。我只需要清理生产缓存:

app/console --env=prod cache:clear

因为我之前正在开发server:run模式。无论如何,我会保留上面的例子,因为它完美无缺。