I downloaded the recent version of xampp and I installed it and everything but when i type "localhost" in the browser it redirects me to localhost/dashboard is there a way to type localhost and see the directories and files like before?
there was some versions of xampp where you just have to change the name of the index.php or delete it and you could see the directories and files in localhost from the browser
does someone knows which versions are? or how to solve the problem?
26 Answers
If you want to display directory than edit htdocs/index.php file
Below code is display all directory in table
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" ""> <html xmlns=""> <head> <title>Welcome to Nims Server</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <link href="server/style.css" rel="stylesheet" type="text/css" /> </head> <body> <!-- START PAGE SOURCE --> <div> <div> <h1>Nims <em>Server</em> Directory list</h1> <div> <form action="#"> <div> <input type="text" name="keyword" /> <input type="image" src="server/images/searchgo.gif" alt="search" /> </div> </form> </div> </div> <div> <div> <table width="100%" border="0" cellspacing="3" cellpadding="5"> <tr> <?php //echo md5("saketbook007"); //File functuion DIR is used here. $d = dir($_SERVER['DOCUMENT_ROOT']); $i=-1; //Loop start with read function while ($entry = $d->read()) { if($entry == "." || $entry ==".."){ }else{ ?> <td width="33%"><a href="<?php echo $entry;?>" ><?php echo ucfirst($entry); ?></a></td> <?php } if($i%3 == 0){ echo "</tr><tr>"; } $i++; }?> </tr> </table> <?php $d->close(); ?> </div> </div> </div> </div></div></body> </html> Style:
@import url("fontface.css"); * { padding:0; margin:0; } .clear { clear:both; } body { background:url(images/bg.jpg) repeat; font-family:"Palatino Linotype", "Book Antiqua", Palatino, serif; color:#212713; } #wrap { width:1300px; margin:auto; } #sitename { font: normal 46px chunk; color:#1b2502; text-shadow:#5d7a17 1px 1px 1px; display:block; padding:45px 0 0 0; width:60%; float:left; } #searchbar { width:39%; float:right; } #sitename em { font-family:"Palatino Linotype", "Book Antiqua", Palatino, serif; } #top { height:145px; } img { width:90%; height:250px; padding:10px; border:1px solid #000; margin:0 0 0 50px; } .post h2 a { color:#656f42; text-decoration:none; } #searchbar { padding:55px 0 0 0; } #searchfield { background:url(images/searchbar.gif) no-repeat; width:239px; height:35px; float:right; } #searchfield .keyword { width:170px; background:transparent; border:none; padding:8px 0 0 10px; color:#fff; display:block; float:left; } #searchfield .searchbutton { display:block; float:left; margin:7px 0 0 5px; } div.background { background:url(h.jpg) repeat-x; border: 2px solid black; width:99%; } div.transbox { margin: 15px; background-color: #ffffff; border: 1px solid black; opacity:0.8; filter:alpha(opacity=60); /* For IE8 and earlier */ height:500px; } .site{ border:1px solid #CCC; } .site a{text-decoration:none;font-weight:bold; color:#000; line-height:2} .site:hover{background:#000; border:1px solid #03C;} .site:hover a{color:#FFF} 2Wanna a list of folder in xampp?
Just delete or change the file index.php to index.txt. And you will get the list just typing url: localhost.

Try this solution:
Go to->
- xammp ->htdocs-> then open index.php from the htdocs folder
- you can modify the dashboard
- restart the server
Example Code index.php :
<?php if (!empty($_SERVER['HTTPS']) && ('on' == $_SERVER['HTTPS'])) { $uri = ' } else { $uri = ' } $uri .= $_SERVER['HTTP_HOST']; header('Location: '.$uri.'/dashboard/'); exit; ?> 0Type in your URL localhost/[name of your folder in htdocs]
1Here's what's actually happening localhost means that you want to open htdocs. First it will search for any file named index.php or index.html. If one of those exist it will open the file. If neither of those exist then it will open all folder/file inside htdocs directory which is what you want.
So, the simplest solution is to rename index.php or index.html to index2.php etc.
Just create file index.php and save it to: C:\xampp\htdocs\
Like User Matiur Rahman. Thanks, it works for me. You can copy this script and paste it into your index.php file.
<?php if (!empty($_SERVER['HTTPS']) && ('on' == $_SERVER['HTTPS'])) { $uri = ' } else { $uri = ' } $uri .= $_SERVER['HTTP_HOST']; header('Location: '.$uri.'/dashboard/'); exit; ?> 