1

如何将子域指向特定的捆绑包。我有这个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.

4

1 回答 1

0

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

app/console --env=prod cache:clear

因为我之前是用server:runmode开发的。无论如何,我将保留上面的示例,因为它可以完美运行。

于 2013-10-01T21:11:13.200 回答