title: Symfony2: Using Prefix with Login Routing
body: <p>I am setting up routing that allows the following routing:</p>
  
  <pre><code>/client_a/dashboard/
  /client_b/dashboard/
  </code></pre>
  
  <p>I am using a prefix in my <code>app/config/routing.yml</code> that looks like this:</p>
  
  <pre><code>AcmeMainBundle:
      resource: "@AcmeMainBundle/Resources/config/routing.yml"
      prefix:   /{client}  
  </code></pre>
  
  <p>The problem I am running into is that the login routing seems to be having issues with the prefix. Here is my entries in the <code>/Resources/config/routing.yml</code> I am importing into the main routing file:</p>
  
  <pre><code>acme_login:
      pattern: /login/
      defaults: {_controller: AcmeMainBundle:Main:login }
  
  acme_login_check:
      pattern: /login_check
      # defaults: This is not required since the Firewall will handle this
  
  acme_logout:
      pattern: /logout/
      # defaults: This is not required since the Firewall will handle this
  </code></pre>
  
  <p>The login page displays fine, but after the user submits the login page, Symfony throws an error stating:</p>
  
  <pre><code>Unable to find the controller for path "/client_a/login_check". Maybe you forgot to add the matching route in your routing configuration?
  </code></pre>
  
  <p>It looks to me that Symfony2 is having difficulties with the internal security routing and using a prefix in routing.yml.</p>
  
  <p>Any way to overcome the issue?</p>
  
  <p>NOTE: One way to get around this issue is by changing all the routes in my routing.yml file to include the {client} parameter. The only problem is that this is a very extensive app with a large number of routes. Using the prefix works wonders, except for the security processing during login.</p>
  
  <p>Thanks,</p>
  
  <p>JB</p>