문제

How can I point a subdomain to a specific bundle. I have this 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>

This /etc/hosts:

127.0.0.1       subdomain1.mysite.dev subdomain2.mysite.dev

And this 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

This way both subdomains goes to Subdomain1Bundle.

도움이 되었습니까?

해결책

Sorry, I'm shamed. I just needed to clean the production cache:

app/console --env=prod cache:clear

Because I was developing before with server:run mode. Anyway I will keep the above example because it works perfectly.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top