I'm using CodeIgniter 1.9 to build a website.
I want http://myurl.com/index.php/user/profile/2 to take me to the Profile Page for the user with the id of 2.
My routes.php file looks like this.
$route['default_controller'] = 'welcome';
$route['404_override'] = '';
$route['user/profile/(:num)'] = 'user/profile_view/$1';
My user.php file looks like this.
class User extends CI_Controller {
function __construct()
{
parent::__construct();
$this->load->model('user_model');
}
function profile_view($id)
{
$data = array();
log_message("info", "I am in the profile_view method of user.php.");
$this->load->view("templates/header", $data);
$this->load->view("templates/footer", $data);
}
}
The code is never making it to the log_message() function and it is throwing a 500 error that says exactly this...
HTTP Error 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfil the request.
Any help would be greatly appreciated. I've been looking for several hours now with no luck.