title: URL rewriting fails because of url encoding
body: <p>I recently implemented versioning on my API project. Now URLs of my api will have to be prefixed by the sequence <code>/v1/</code> (As I'm currently on v1)</p>
  
  <p>I don't want to break old calls, so to ensure transparent compatibility, I want to rewrite the old urls.</p>
  
  <p>Url like <code>/events/9999/attendees</code> should be redirected to <code>/v1/events/9999/attendees</code></p>
  
  <p>I set this up with my rails routes config file <code>routes.rb</code> with the following code :</p>
  
  <pre><code>match "*path", :to =&gt; redirect("/#{API_CONFIG['current_version']}/%{path}"),
  :constraints =&gt; lambda { |request| true }
  </code></pre>
  
  <p>The issue I'm facing now is that the final rewritten route seems to be url-encoded ... (or something) <em>Actually, that's the</em> <code>%{path}</code> <em>that seems to be broken</em>. Then :</p>
  
  <p><code>/events/9999/attendees</code> is redirected to <code>/v1/events%2F9999%2Fattendees</code></p>
  
  <p>What am I doing wrong ?</p>
  
  <p>Many thanks</p>