[eluser]boltsabre[/eluser]
This is easier, saves keeping track of this stuff in your $routes file
Code:
public function index(){
$user = $this->uri->segment(2);
if( !isset ($user)){
// redirect them where ever you want
}else{
// everything is fine, lets continue
}
}
I personally don't like to uri segments as method arguments, if for whatever reason they are missing CI throws a "argument missing" (cannot remember the exact text off the top of my head) php error. The above method lets you handle missing arguments gracefully (in my humble opinion).