title: Spring URL mapping conflicts
body: <p>At the moment I am bussy with implementing a new url structure for our webshop. The new url structure should be more optimized for search engines. We also want that our old structure will still be working and will use a 301 to redirect to a the new structure.</p>
  
  <p>The problem is: the new structure sometimes conflicts with the old urls. </p>
  
  <p>Example of the old url mapping:</p>
  
  <pre><code>@RequestMapping(value = "/brand/{categoryCode}/{categoryName}/{brandGroup}.do", method = RequestMethod.GET)
  </code></pre>
  
  <p>New structure:</p>
  
  <pre><code>@RequestMapping(value = "/brand/{brandGroup}/{superCategoryName}/{categoryName}.do", method = RequestMethod.GET)
  </code></pre>
  
  <p>As you can see the url's have the same amount of values, so the old mapping will catch the new one and vice versa.</p>
  
  <p>What is the best way to fix this? Using a url filter to rewrite the old ones to the new url structure?</p>