Whenever, i open localhost, it is opened as http://localhost/dashboard/. But i want when i open localhost (http://localhost/) in browser, all the list of files and directories will be show. Please anyone can tell me, how to do this.
Whenever, i open localhost, it is opened as http://localhost/dashboard/. But i want when i open localhost (http://localhost/) in browser, all the list of files and directories will be show. Please anyone can tell me, how to do this.
2
Answers
If you want the content under
/dashboard
to be available at the root onhttp://localhost
, you need to point your site’s webroot to that directory, so it’s the entry point for your web server.Open
/etc/apache2/conf/httpd.conf
in a text editor of your choice and find<Directory "/var/www">
edit the path to point to your dashboard, something like that:
<Directory "/var/www/dashboard">
as final step you need to restart your apache2
sudo service apache2 restart
It may happen if installation of WAMPP/LAMPP/XAMPP stack software (Windows/ Linux) is a fresh one.
If so, in this cause it is happening due to a statement in index.php (automatically created file during installation) file which is in root folder of the fresh installation of wampp/lampp/xampp stack.
You can simply remove/rename/ replace this index.php file or comment the following lines in index.php
If it is not the cause try these things in depends on your os/server
1)create virtual host Windows xampp
2)create virtual host apache
3)create virtual host Lamp Linux distributions