[eluser]InsiteFX[/eluser]
Use _remap method
Code:
// ./application/config/routes.php
// ------------------------------------------------------------------------
/**
* DO NOT! REMOVE THIS LINE
* This is for the members _remap. Must be the last line in routes file!!!
* ------------------------------------------------------------------------
*/
$route['(.*)'] = 'welcome/index/$1';
// ------------------- -== DO NOT REMOVE! the above line ==- --------------
// Controller index method
// --------------------------------------------------------------------
/**
* index()
*
* index - default method called.
*
* @access public
* @return void
*/
public function index($member = NULL)
{
if ( ! empty($member))
{
// URL contains a member name!
}
else
{
// No member name passed!
}
}
// _remap method
// --------------------------------------------------------------------
/**
* _remap()
*
* Remaps the URL segments.
*
* @access private
* @param string
* @param array
* @return mixed
*/
public function _remap($method, $params = array())
{
if (method_exists($this, $method))
{
return call_user_func_array(array($this, $method), $params);
}
show_404();
}