title: URI Routing for codeigniter
body: <p>I'm trying to figure out how I should do this. The following controller is for a bio page for each wrestler. Here's an example.</p>
  
  <p><a href="http://kansasoutlawwrestling.com/bio/kid-wonder" rel="nofollow">http://kansasoutlawwrestling.com/bio/kid-wonder</a></p>
  
  <p>Now if you notice there's three links Biography, Wrestling, Appearances.</p>
  
  <p>One question I have is should all three be different functions inside this controller?</p>
  
  <p>If the answer is yes are the links actually correct on the page link?</p>
  
  <pre><code>&lt;?php 
  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
  
  class Bio extends CI_Controller
  {
  
  function index($character = "jfkdlsjl")
  {
  
      //Config Defaults Start
      $msgBoxMsgs = array();//msgType = dl, info, warn, note, msg
      $cssPageAddons = '';//If you have extra CSS for this view append it here
      $jsPageAddons = '';//If you have extra JS for this view append it here
      $metaAddons = '';//Sometimes there is a need for additional Meta Data such in the case of Facebook addon's
      $siteTitle = '';//alter only if you need something other than the default for this view.
      //Config Defaults Start
  
  
      //examples of how to use the message box system (css not included).
      //$msgBoxMsgs[] = array('msgType' =&gt; 'dl', 'theMsg' =&gt; 'This is a Blank Message Box...');
  
      /**********************************************************Your Coding Logic Here, Start*/
  
  
      $activeTemplate = $this-&gt;sitemodel-&gt;getTemplate();
      $footerLinks = $this-&gt;sitemodel-&gt;getFooterNav();
      $bodyContent = "bio";//which view file
      $bodyType = "main";//type of template
      $this-&gt;data['activeTemplate'] = $activeTemplate;
      $this-&gt;data['footerLinks']= $footerLinks;
      $this-&gt;load-&gt;model('biomodel');
      if($character !== "jfkdlsjl")
      {
          if((!empty($character))||(!isset($character))||(trim($character) !== '')||($character !== NULL))
          {
              $bioArray = $this-&gt;biomodel-&gt;getCharacterBio($character);
              if ($bioArray == "empty")
              {
                  $this-&gt;data['bioArray']= array();
              }
              else
              {
                  if (($bioArray[0]-&gt;characters_statuses_id == 2)||($bioArray[0]-&gt;characters_statuses_id == 3)||($bioArray[0]-&gt;characters_statuses_id == 5))
                  {
                      $this-&gt;data['bioArray']= array(); 
                  }
                  else
                  {
                      $this-&gt;data['bioArray']= $bioArray;
                      $bioPagesArray = $this-&gt;biomodel-&gt;getBioPages();
                      $alliesArray = $this-&gt;biomodel-&gt;getCharacterAllies($bioArray[0]-&gt;id);
                      $rivalsArray = $this-&gt;biomodel-&gt;getCharacterRivals($bioArray[0]-&gt;id);
                      $quotesArray = $this-&gt;biomodel-&gt;getCharacterQuotes($bioArray[0]-&gt;id);
                      $this-&gt;data['bioPagesArray']= $bioPagesArray;
                      $this-&gt;data['alliesArray']= $alliesArray;
                      $this-&gt;data['rivalsArray']= $rivalsArray;
                      $this-&gt;data['quotesArray']= $quotesArray;
                  }
              }
          }
      }
  
      /***********************************************************Your Coding Logic Here, End*/
  
      //Double checks if any default variables have been changed, Start.
      //If msgBoxMsgs array has anything in it, if so displays it in view, else does nothing.
      if(count($msgBoxMsgs) !== 0)
      {
          $msgBoxes = $this-&gt;msgboxes-&gt;buildMsgBoxesOutput(array('display' =&gt; 'show', 'msgs' =&gt;$msgBoxMsgs));
      }
      else
      {
          $msgBoxes = array('display' =&gt; 'none');
      }
  
      if($siteTitle == '')
      {
          $siteTitle = $this-&gt;metatags-&gt;SiteTitle(); //reads
      }
  
      //Double checks if any default variables have been changed, End.
  
      $this-&gt;data['msgBoxes'] = $msgBoxes;
      $this-&gt;data['cssPageAddons'] = $cssPageAddons;//if there is any additional CSS to add from above Variable this will send it to the view.
      $this-&gt;data['jsPageAddons'] = $jsPageAddons;//if there is any addictional JS to add from the above variable this will send it to the view.
      $this-&gt;data['metaAddons'] = $metaAddons;//if there is any addictional meta data to add from the above variable this will send it to the view.
      $this-&gt;data['pageMetaTags'] = $this-&gt;metatags-&gt;MetaTags();//defaults can be changed via models/metatags.php
      $this-&gt;data['siteTitle'] = $siteTitle;//defaults can be changed via models/metatags.php
      $this-&gt;data['bodyType'] = $bodyType;
      $this-&gt;data['bodyContent'] = $bodyContent;
      $this-&gt;load-&gt;view($activeTemplate[0]-&gt;short_name.'/index', $this-&gt;data);
  
  }
  }
  
  /* End of file bio.php */
  /* Location: ./application/controllers/bio.php */
  </code></pre>
  
  <p>EDIT: I'm really concerned with the biography page link when I'm on the bio page like the link above.</p>
  
  <p>Here's what I have currently for my route: $route['bio/(:any)'] = "bio/index/$1";</p>