search

Home  >  Q&A  >  body text

How to configure multiple subdomain names under symfony 2

How to configure multiple subdomain names under symfony 2 Main domain name www.xxx.com xxxcontroller I only allow access to the test.xxx.com domain name. How is this configured?

为情所困为情所困2753 days ago419

reply all(1)I'll reply

  • 大家讲道理

    大家讲道理2017-05-16 16:47:13

    Only supported by 2.2 and above:

    (1) Individually assigned to a certain action:

    some_routing:
        path: /some_path
        host: "{host}.example.com"
        defaults: { _controller: SomeDemoBundle:Some:exampleAction }
    

    (2) Assign batches to a Controller

    First use annotations in this Controller or write yaml routing for it, then import this group of routing, and uniformly restrict the host:

    some_routing:
        resource: "@SomeDemoBundle/Resources/config/routing.yml"
        host:     "host.example.com"
    

    reply
    0
  • Cancelreply