[eluser]Iverson[/eluser]
[quote author="Dyllon" date="1232421660"]I had to do this a while ago, I didn't want to use URL suffixes so I extended the CI Router as follows
application/libraries/My_Router.php
Code:
class MY_Router extends CI_Router {
function MY_Router()
{
parent::CI_Router();
}
function _validate_request($segments)
{
// Does the requested controller NOT exist?
if (!file_exists(APPPATH.'controllers/'.$segments[0].EXT))
{
$segments = array("users","profile",$segments[0]);
}
}
return parent::_validate_request($segments);
}
[/quote]
In other news, I don't see how this actually worked. You can't have a return outside a function in a class.... :bug:
For anyone looking to cut and paste, you'll have to move
return parent::_validate_request($segments); inside of
_validate_request()