Symfony2 Routing – route subdomains

Just to point out that this is now added in Symfony v2.2 – http://symfony.com/doc/master/components/routing/hostname_pattern.html.

mobile_homepage:
    path:     /
    host:     m.{domain}
    defaults: { _controller: AcmeDemoBundle:Main:mobileHomepage }
    requirements:
        domain: %domain%

homepage:
    path:  /
    defaults: { _controller: AcmeDemoBundle:Main:homepage }

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)