比方说,我有多个(子)域的网站:具有多个域
- acme.com(USA)
- acme.nl(荷兰)
- be.acme .eu域名(比利时)
- de.acme.eu(德国)
- fr.acme.eu(法国)
- 等...
我想这应该是配置非常简单,所以我做了这个的routing.yml:
usa:
host: "acme.com"
resource: "@WebsiteBundle/Controller/"
type: annotation
defaults:
country: "en"
netherlands:
host: "acme.nl"
resource: "@WebsiteBundle/Controller/"
type: annotation
defaults:
country: "nl"
europe:
host: "{country}.acme.eu"
resource: "@WebsiteBundle/Controller/"
type: annotation
但是,如果我跑router:debug
,只有最后一个路径(在这种情况下{country}.acme.eu
)显示出来。如果我更改为订单,最后一个选项显示。
如何为我所有的国家使用不同的(子)域?
我认为你是对的,这是不可能有多个路由/ hosts中指出,一个资源:http://github.com/symfony/ symfony/issues/6857 –