Here is my routing.yml file
admin:
path: /
host: "admin.devhostname.com"
defaults:
_controller: AdminBundle:Default:index
app:
resource: "@AppBundle/Controller/"
type: annotation
prefix: /
Everything works fine, except admin.devhostname.com/contact_us
matches my app
routing for contact_us
. Because app:
routing catches ANY
host config. To get the result I want I need to add host:
to every other route config. Is there any better way to achieve this?
Here is what solution I figured out. So far is the best way.
I moved all site related routes in another file routing_site.yml and then included that routing with host
.
admin:
path: /
host: "admin.%domain%"
defaults:
_controller: AdminBundle:Default:index
app:
resource: routing_site.yml
host: "%domain%"