我试图设置Symfony路由。我正在使用Symfony 2.7。我有两个在不同子域下工作的软件包。域名可以是通配符,tld可以是多个。在子域和tld的Symfony路由配置中使用通配符
这是我目前的配置文件:
company_api:
resource: "@ApiBundle/Controller/"
type: annotation
prefix: /
company_core:
resource: "@CoreBundle/Controller/"
type: annotation
prefix: /
我想第一包仅在子域“API”的作品,域可以是一个通配符,为TLD我要指定一些像(NL | EU)。
编辑
company_core:
resource: "@ApiBundle/Controller/"
type: annotation
prefix: /
host: www.mydomainname.{tld}
defaults:
tld: nl
requirements:
tld: "nl|eu"
我NOG upgarde的配置这种设置。而且tld的工作是正确的。只有这样才有可能为域名“mydomainname”使用通配符?这很容易,因为dev和producten服务器使用不同的域名。
您能否提供一个或两个您尝试过的配置无效的示例? – likeuntomurphy