title: Symfony routing with an API Web Service
body: <p>I'm finishing the API of our web service. Now I'm thinking on how to make the route changes, so if we decide to make a new version we don't break the first API.</p>
  
  <p>right now:</p>
  
  <pre><code>url: /api/:action
  param: { module: api, action: :action }
  requirements:
    sf_format: (?:xml|json)
  </code></pre>
  
  <p>what i've thought:</p>
  
  <pre><code>url: /api/v1/:module/:action
  param: { module: api1, action: :action }
  requirements:
    sf_format: (?:xml|json)
  
  url: /api/v2/:module/:action
  param: { module: api2, action: :action }
  requirements:
    sf_format: (?:xml|json)
  </code></pre>
  
  <p>That's easy, but the perfect solution would be to have the following kind of route</p>
  
  <pre><code># Automatically redirects to one module or another
  url: /api/v:version/:module/:action
  param: { module: api:version, action: :action }
  requirements:
    sf_format: (?:xml|json)
  </code></pre>
  
  <p>any ideas on how to do it? what do you recommend us to do?</p>
  
  <p>thanks!</p>