title: CodeIgniter Route rsegment() Duplicates End Value
body: <p>Using CodeIgniter route I have this rule</p>
  
  <pre><code>$route['^(?!login|profile|signup|notification|member).*/(:num)/(:any)/(:any)'] = "home/$2/$0/$1/$3";
  </code></pre>
  
  <p>My URL would be something like this <code>http://example.com/memberfolder/7/view_document/WjbZpAPHM6</code></p>
  
  <p>So basically the code should route to <code>view_document()</code> method in the home class with <code>rsegment(5)</code> being value <code>WjbZpAPHM6</code></p>
  
  <p>However, when the code goes to the home class, <code>rsegment(5)</code> value is <code>view_document</code>.</p>
  
  <p>As you can see for my routing rule I should only have 5 rsegments, so when I printed all rsegments I got this:</p>
  
  <blockquote>
    <p>home view_document memberfolder 7 view_document WjbZpAPHM6</p>
  </blockquote>
  
  <p>As you can see my <code>rsegment(5)</code> is a duplicate or <code>rsegment(2)</code>. Even though I should have only 5 rsegments, my document file value <code>WjbZpAPHM6</code> is stored in <code>rsegment(6)</code>.</p>
  
  <p>Any advice on how to correct <code>rsegment(5)</code> to be the value of the document name rather then <code>view_document</code></p>
  
  <p>Also, my <code>.htaccess</code> is as such:</p>
  
  <pre><code>RewriteEngine On
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ /example/index.php/$1 [L]
  </code></pre>