【发布时间】:2009-07-31 23:09:13
【问题描述】:
由于某种原因,对 header() 的调用会导致我出现内部服务器错误。我正在使用 PHP5 并在此脚本中广泛使用 mod_rewrite(如果有帮助的话)。这是代码(有点):
<?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]
【问题讨论】: