In Symfony 2, how do I handle routing for multiple domains?

后端 未结 1 547
余生分开走
余生分开走 2021-01-07 07:17

I have my app setup to use 3 subdomains, I also have 2 domains that point to the same app, giving me this set of FQDNs

admin.domain1.com, admin.domain2.com

w

相关标签:
1条回答
  • 2021-01-07 08:02

    You can use placeholders in routes, so try something like this:

    incompass_kiosk:
        host:     "kiosk.{domain}.com"
        resource: "@IncompassKioskBundle/Resources/config/routes.yml"
        requirements:
            domain: domain1|domain2
        defaults: { domain: domain1 }
    

    You could alternatively handle this in your .htaccess or virtual host configuration.

    0 讨论(0)
提交回复
热议问题