title: Is there a way to map one url to another in Play Framework
body: <p>I'm using Play Framework 2.4.3.  I want to change some of the urls in my routes file, but it turns out there's a database table that has a column of urls. (The user is shown a list of alerts, and each one has a link to the page to which the alert applies.)</p>
  
  <p>I might be able to update the data in the database with the new urls, or translate them at run-time, but I thought a potentially easier solution would be to somehow map the old urls to the new ones.  So for example, my routes file looks like this:</p>
  
  <pre><code>#this is the new url
  GET /views/producers/:partyId   controllers.ProducerController.viewProducer(partyId:Integer)
  
  #this is the old url
  GET /producer/view/:partyId     controllers.ProducerController.viewProducer(partyId:Integer)
  </code></pre>
  
  <p>In the table I have values that look like this:</p>
  
  <blockquote>
    <p>/producer/view/123</p>
  </blockquote>
  
  <p>I can make it work by keeping both entries in the routes file.  Reverse routing will pick up the first one, and both links work.  But I would rather not have the controller function listed twice (and risk them becoming out of sync), and I also would rather have the user see the same url in the browser regardless of how they got there.</p>
  
  <p>Is there a way I can map the old url to the new url?</p>