CodeIgniter 1.9를 사용하여 웹 사이트를 구축하고 있습니다. Codeigniter에서 작동하지 않는 경로
나는 내 routes.php 파일은 다음과 같습니다 2.의 ID와 사용자의 프로필 페이지에 데려다 http://myurl.com/index.php/user/profile/2를 원한다.
$route['default_controller'] = 'welcome';
$route['404_override'] = '';
$route['user/profile/(:num)'] = 'user/profile_view/$1';
내 user.php 파일은 다음과 같습니다.
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);
}
}
이 코드는 결코 log_message() 함수에 그것을 만들기되지 않고 정확히이라는 500 오류 ... 던지고있다
HTTP 오류 500 (내부 서버 오류) : 예기치 않은 서버가 요청을 수행하는 동안 조건이 발생했습니다.
도움을 주시면 감사하겠습니다. 나는 지금 운이없는 몇 시간을 찾고 있었다.
apache/webserver 로그의 내용은 무엇입니까? htaccess를 사용하고 있습니까? – stormdrain
온전한 확인 : 라우팅되지 않은 URL이 작동합니까? 'http : // myurl.com/index.php/user/profile_view/2' 나는이 문제가 라우팅과 직접 관련이 있는지 의심 스럽다. –
아니요, 라우팅되지 않은 URL이 작동하지 않습니다. 다른 경로가 작동 중이므로 라우팅 문제라고 가정했습니다. 코드는 라우팅 잘 전달되었다 (나는 라우팅하기 직전에 log_message 호출을했다). 그러나 컨트롤러에 연결되지 않습니다. –