title: Codeigniter - How to get and change uri segement then redirect?
body: <p>In my web application I have a url that looks like the following:</p>
  
  <pre><code>http://mydomain.com/search/index/list/for-sale/london/0/0/0/0
  </code></pre>
  
  <p>I would like to use the uri class and redirect to change <code>$this-&gt;uri-&gt;segment(3);</code> to <code>map</code> and then redirect.</p>
  
  <p>So that once redirected and the segment has been changed the url would look like:</p>
  
  <p>/search/index/map/for-sale/london/0/0/0/0</p>
  
  <p>How would I go about doing this?</p>