symfony/symfony — pull request #3057 by gunnarlium (2012-01-08 00:25:22+00:00)
Title: [Routing] added support for hostname requirement to routes

Bug fix: no
Feature addition: yes
Backwards compatibility break: no
Symfony2 tests pass: yes (All Routing tests pass, Locale tests fail on my localhost, but I have not touched those files)
Fixes the following tickets: -
Todo:
- Add documentation if feature is approved
- Maybe add/test wildcard support

This patch adds support for hostname requirements on routes:

hostbased_route:
pattern: /
requirements:
_host: symfony.com|symfony.org

This route would only match if RequestContext::getHost() matches symfony.com or symfony.org.