title: codeigniter 301 redirect with router for old url and remaning no redirect
body: <p>I have a codeigniter site, for which i am doing SEO, so the issue is most of the urls are cached in search engines, what my old url is</p>
  
  <pre><code>/product/details/productname/productid
  </code></pre>
  
  <p>My new urls will be </p>
  
  <pre><code>/tours/cityname/productname
  </code></pre>
  
  <p>I want for my old urls to be redirected to new with 301, and new product url not to be redirected with 301 as they are new and will have the same url structure, as I search on codeigniter site about url routing in router.php, which gives an example for redirection as </p>
  
  <pre><code>$route['product/(:num)'] = "catalog/product_lookup_by_id/$1";
  </code></pre>
  
  <p>I think that this where i can make the change but how can i do a 301 in this pattern, by using header or is there a better way of doing this ?</p>