XAMPP localhost重定向到localhost/dashboard

Lum*_*Lum 7 xampp

我刚刚安装了xampp-win32-5.5.30并在xampp控制面板中启动了Apache和mysql,没有任何错误,但我发现:

1)我的浏览器中的localhost重定向到另一个页面localhost/dashboard /而不是xampp起始页面.

2)localhost/xampp显示以下内容:

Index of /xampp

[ICO]   Name    Last modified   Size    Description
[PARENTDIR] Parent Directory        -    
Apache/2.4.17 (Win32) OpenSSL/1.0.2d PHP/5.5.30 Server at localhost Port 80
Run Code Online (Sandbox Code Playgroud)

C:\ 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 :-(
Run Code Online (Sandbox Code Playgroud)

安装有问题吗?

Puj*_*hah 5

删除该文件(index.php),您将从 htdocs 文件夹中获得目录和文件列表。


Fis*_*her 2

这:

header('Location: '.$uri.'/dashboard/');
Run Code Online (Sandbox Code Playgroud)

执行重定向到 localhost/dashboard/

一切都按预期工作,如果您清除此文件并输入一些文本,例如“Hello world”,您应该在http://localhost/上看到它