2013-02-21 493 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,但我敢肯定,這是它的實現。