为什么将项目托管到Apache,浏览器输入http://127.0.0.1会跳转到http://127.0.0.1//dashboard/?

找到xampp安装的根目录下htdocs文件夹下的index.php文件

<?php
    if (!empty($_SERVER['HTTPS']) && ('on' == $_SERVER['HTTPS'])) {
        $uri = 'https://';
    } else {
        $uri = 'http://';
    }
    $uri .= $_SERVER['HTTP_HOST'];
    header('Location: '.$uri.'/dashboard/');
    exit;
?>
Something is wrong with the XAMPP installation :-(

把以下语句注释即可

header('Location: '.$uri.'/dashboard/');

参考博客:macOS -- 为什么XAMPP启动后输localhost跳转到http://localhost/dashboard?

猜你喜欢

转载自www.cnblogs.com/songsongblue/p/11995869.html