New in Symfony 2.4: Restrict Security Firewalls to specific Hosts
Symfony 2.2 introduced host support in the routing system. Symfony 2.4 does the same for the security firewall configuration.
When configuring a firewall, you can restrict it to a given URL path pattern,
1 2 3
admin: pattern: ^/admin http_basic: true
But what if you want to restrict it to
admin.example.com instead? As of
Symfony 2.4, this is really easy:
1 2 3 4
host: pattern: ^/ host: admin\.example\.com http_basic: true
Simple and powerful!
New in Symfony 2.4: Restrict Security Firewalls to specific Hosts symfony.com/blog/new-in-symfony-2-4-restrict-security-firewalls-to-specific-hostsTweet this
Become a certified developer! Exams are online and available in all countries.Register Now
Comments are closed.
To ensure that comments stay relevant, they are closed for old posts.