title: Symfony routing - locale as subdomain with fallback to default
body: <p>I'm trying to set up routing system with subdomain representing current locale. Routing is set via <code>@Routing</code> annotation and looks like this:</p>
  
  <pre><code>/**
   * @Route(
   *      "/",
   *      name="homepage",
   *      host="{locale}.{domain}",
   *      defaults={"locale" = "en", "domain" = "%domain%"},
   *      requirements={"locale" = "en|de|fr", "domain" = "%domain%"}
   * )
   */
  </code></pre>
  
  <p>Works well for URL's like <code>en.somedomain.com</code> or <code>de.somedomain.com</code>, but fails to find correct route for <code>somedomain.com</code>, without locale.</p>
  
  <p>I understand that because of the <code>host</code> parameter, that is set to represent exact <strong>locale.domain</strong> pattern, but I can't find way to tell Symfony routing system that there could be additional, default <code>host</code>.</p>
  
  <p>Searched all around for this, but found nothing particular. Would appreciate any help!</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>There is actually a way to do it, by adding another <code>@Route</code> in annotation, without <code>host</code> parameter:</p>
  
  <pre><code>/**
   * @Route(
   *      "/",
   *      name="homepage_default",
   *      defaults={"locale" = "en"}
   * )
   */
  </code></pre>
  
  <p>but thats looks a bit dirty, and I'm not using <code>%domain%</code> parameter there, which is important for me - say, if I would need another subdomain for mobile version.</p>