[eluser]new_igniter[/eluser]
Hello,
I am building profile pages for a site I am working on an using the "reserved routes" method (show in the code below) so that I can present a url like sitedomain.com/username
Code:
$url_parts = explode('/',$_SERVER['REQUEST_URI']);
$reserved_routes = array("splash","user");
if (!in_array($url_parts[1], $reserved_routes)) {
$route['([a-zA-Z0-9_-]+)'] = "user/index/$1";
}
The code above works great and get no errors.
My problem
I want to be pass in an optional second parameter on the user/index function, so that I have username/parameter but when I add this parameter this I get a 404. I am guessing I need to map the parameter, but would like to know the best way to do this.
My controller function for "user" looks like this:
Code:
function user($userName,$type=null) {
}
Any help is greatly appreciated.