I have a route in my Symfony project that should be restricted only to hosts that contains a specific word in a subdomain, a domain is not important and it will vary. Lets say this specific word is 'pre', so I want only hosts build like this (pre.anything.com, pre.anything2.co.uk, pre.anything3.us) to access certain route. Is it possible to configure it as such in a symfony routing?
routes.yaml
base_register:
path: /register/
host: "/pre/"
defaults: { _controller: App\Controller\AppController::registerAction }
Using:
- Symfony 4.2
- PHP 7.2