어떤 이유로 인해 header()를 호출하면 내부 서버 오류가 발생합니다. PHP5를 사용하고 있고이 스크립트에서 mod_rewrite를 광범위하게 사용합니다 (도움이된다면).PHP 헤더()로 인해 내부 서버 오류가 발생합니다
이<?php
include 'core/initialize.php'; // Loads the core class (and session manager class)
if($_GET['reset'] == 'true')
{
$core->Session->Visits = 0;
header('Location', 'index.html');
# header('X-Test', 'wtf'); // causes the error too :(
}
if(isset($core->Session->Visits)) $core->Session->Vists += 1;
else $core->Session->Visits = 0;
echo "Previous Visits: {$core->Session->Visits} (<a href='index.html?reset=true'>Reset</a>)";
?>
내 htaccess로 파일은 다음과 같습니다 :
# Start up the rewrite engine
Options +FollowSymLinks
RewriteEngine on
RewriteRule ^(.*)$ navigator.php?nav=$1&%{QUERY_STRING} [NC]
지금은 꽤 바보 같아요. 감사합니다 –
@Chris T - 그것에 대해 너무 걱정하지 마십시오. 조만간 모든 유능한 프로그래머들은 애매한 것을 보는 것의 가격이 때때로 명백한 것을 놓치는 것임을 알게됩니다. ;-) –
@Chris : 걱정하지 마세요. 나는 누군가가 우리의 코드를 보면서 정말로 도움이 될 수 있음을 안다. 때때로 :-) (btw, error_log에 대한 다른 정보를주기 위해 나의 대답을 편집했다.) –