2013-02-21 482 views
5

美好的一天,伙计们!http://localhost/index.php重定向到http:// localhost/xampp/

为话题已经说,本地主机被重定向我的XAMPP页面。我试图做的是打开一个自定义的index.php页面,它位于我的项目文件夹内,而项目文件夹位于htdocs文件夹内。重新安装xampp没有帮助。昨天一切正常,并且.php内没有任何变化。任何帮助表示赞赏!

回答

6

Xampp中的索引文件重定向到xampp文件夹。 更改默认的项目

<?php 
    if (!empty($_SERVER['HTTPS']) && ('on' == $_SERVER['HTTPS'])) { 
     $uri = 'https://'; 
    } else { 
     $uri = 'http://'; 
    } 
    $uri .= $_SERVER['HTTP_HOST']; 

    //CHANGE THIS LINE 
    header('Location: '.$uri.'/xampp/'); 
    //header('Location: '.$uri.'/yourproject/'); 

    exit; 
?> 
Something is wrong with the XAMPP installation :-(

或放在浏览器:

的http://本地主机/ YourProject/index.php文件

+1

谢谢你,为我工作! – 2013-02-21 17:07:03

-1

本地主机/ XAMPP/index.php文件

我使用WAMP,但我敢肯定,这是它的实现。