Cannot access to localhost/xampp/index.php

77,002

Solution 1

Ok, Create a page yourpage.html / yourpage.php whatever, you have to put all your pages in a folder in C:\Xampp\htdocs\ dir

Then try accessing following url:

localhost/yourpage.html

or

localhost/yourpage.php

That should work.

Solution 2

In Xampp the default page will redirect you to /Dashboard Folder because it is sending the header Location:http://localhost:80/Dashboard to browser and browser understands that and redirects it.

The answer by @Sumeet Gavhale is correct. And instead of C://Xampp/htdocs folder xampp use to host contents inside /htdocs folder so if you want to find C://Xampp/htdocs/index.php type localhost/index.php (but that will redirect you to /htdocs/Dashboard folder).

If you want to change the hosting folder you should edit the Apache http/https configuration file (but that depends on your OS and file system).

Note : The Default Page Word referred in second line of this answer means the document's name in the default documents in your Server (xampp in your case) (for eg: index.htm ,index.html , index.php etc). Will be loaded in your server and will be different in other's case (if they have done that) (index.php in first case (if not edited)).

Index.php Of Xampp's Source Code

<?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 :-(

But if you still want to view (execute) the page enter "//" in front of last and second last line.

Share:
77,002
S.Joe
Author by

S.Joe

Updated on August 23, 2021

Comments

  • S.Joe
    S.Joe over 2 years

    I just installed XAMPP for windows 7, control panel seems to work fine, I started MySql and Apache, the problem I have is, when I type localhost in my browser "Google Chrome" it sends me to "http://localhost/dashboard/"

    when I change the url to "//localhost/xampp/index.php", it tells me: "Object not found!

    The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again.

    If you think this is a server error, please contact the webmaster.

    Error 404

    localhost Apache/2.4.16 (Win32) OpenSSL/1.0.1p PHP/5.6.11"

    anyone can helps me out with this? Thanks.

  • S.Joe
    S.Joe over 8 years
    I understand what you are trying to tells me, however I don't want to make a website yet, i want to access the main page of the xampp, which i can add a password and stuff like that
  • Román
    Román about 4 years
    Any solution? I deleted unintentionally the xampp index file and now I need to go there.
  • Jeff Richards
    Jeff Richards over 2 years
    It would be helpful to know why the index.php request is doing the redirect. Is it the contents of the index.php file? Or is it something at a higher level (like apache config) that is doing the redirect.
  • Devanshu Sharma
    Devanshu Sharma over 2 years
    @JeffRichards Thank you for Improvement i Have Posted the Index.php file