php - Use wildcards in Symfony routing configuration for subdomain and tld -


i tried setup symfony routing. i'm using symfony 2.7. have 2 bundles work under different subdomain. domainname can wild card , tld can multiple.

here current config file:

company_api: resource: "@apibundle/controller/" type:     annotation prefix:   /  company_core: resource: "@corebundle/controller/" type:     annotation prefix:   / 

i want first bundle works under subdomain "api", domain can wildcard , tld want specify few (nl|eu).

edited

company_core: resource: "@apibundle/controller/" type:     annotation prefix:   / host:     www.mydomainname.{tld} defaults:     tld: nl requirements:     tld: "nl|eu" 

i have nog upgarde config setup. , tld works correct. possible have wildcard domain name "mydomainname"? easy dev , producten server use different doamain names.

here example of use on 3.1 app, use placeholder top-level domain varies environment —

app:     resource: "@appbundle/controller/"     type: annotation     host: www.example.{tld}     defaults:         tld: "%tld%"     requirements:         tld: "%tld%" 

i don’t see why following not work api routes, should compatible 2.7 according the docs:

company_api:     resource: "@apibundle/controller/"     type: annotation     host: api.{domain}.{tld}     defaults:         domain: yourdefaultdomain         tld: nl     requirements:         tld: "nl|eu" 

i remember during development routing config seemed aggressively cached, always, sure clear cache after making routing changes.


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -