Symfony2 Subdomain Routing - Different Bundles

php, symfony

Solution

There is a discussion going on to add this feature.

Problem

EDIT There is now the possibility of doing this in symfony 2.2 ``` PlatformFooBundle: resource: "@PlatformFooBundle/Resources/config/routing.php" domain: foo.testdomain.com PlatformBarBundle: resource: "@PlatformBarBundle/Resources/config/routing.php" domain: bar.testdomain.com PlatformBazBundle: resource: "@PlatformBazBundle/Resources/config/routing.php" domain: baz.testdomain.com ``` You can use parameters in the domain as well EDIT OVER Before marking this as a duplicate, read on http://www.craftitonline.com/2011/08/symfony2-locale-on-subdomains-not-on-the-url-path/ I've read this article, but it doesnt help me do what im trying to do. i have 3 different applications that are running on the same domain name, with seperate subdomains. Currently, theya re all running in their own symfony install, and i'd like to get rid of that. ``` foo.testdomain.com bar.testdomain.com baz.testdomain.com ``` each of these use different bundles ``` PlatformFooBundle PlatformBarBundle PlatformBazBundle ``` and they each have their own route definitions. basically, what i want is this ``` PlatformFooBundle: resource: "@PlatformFooBundle/Resources/config/routing.php" subdomain: www|devwww PlatformBarBundle: resource: "@PlatformBarBundle/Resources/config/routing.php" subdomain: bar|devbar PlatformBazBundle: resource: "@PlatformBazBundle/Resources/config/routing.php" subdomain: baz|devbaz ``` how do i go about doing this?

Original source