我有一个从“pages”文件夹加载页面的脚本。我们已经成功地从index.php文件中加载了它,并且它运行良好。
现在我们已经将连接从http更改为https,我们收到500错误。是否有可能https不允许我们的脚本或是否有其他工作?
这是位于index.php文件中的脚本加载器:
<?php
// 301 redirects
$redirectsTo = '';
$pathinfo = pathinfo($_SERVER['REQUEST_URI']);
if(isset($pathinfo['extension']))
{
if($pathinfo['dirname'] != '/')
$redirectsTo = "{$pathinfo['dirname']}/{$pathinfo['filename']}";
else
$redirectsTo = "{$pathinfo['filename']}";
}
if($pathinfo['filename'] == 'index')
{
$redirectsTo = "{$pathinfo['dirname']}/";
}
if(!empty($redirectsTo))
{
$statusCode = 301;
header("{$_SERVER['SERVER_PROTOCOL']} $statusCode Moved Permanently");
header("Location: $redirectsTo");
exit;
}
// script loader
if(!isset($_SERVER['REDIRECT_URI']))
{
$load = 'pages/home.php';
}
else
{
$script = $_SERVER['REDIRECT_URI'];
$exploded = explode('/', $script);
$script = end($exploded);
$load = "pages/{$script}.php";
}
if(!file_exists($load))
{
$load = '404.php';
}
require_once '_local.php';
include $load;