功能是否因安全的SSL连接而异?

时间:2018-06-06 22:57:44

标签: php function ssl

我有一个从“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;

0 个答案:

没有答案