Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

when I try to open an HTML file through `http://localhost/xampp/htdocs/index.html` it says unable to connect to localhost

Tags:

html

xampp

I have installed XAMPP , there is a htdocs folder and inside it index.html file , when I try to open it in my browser through http://localhost/xampp/htdocs/index.html it says unable to connect to localhost .

what is wrong ?

like image 683
user1841718 Avatar asked Dec 06 '22 09:12

user1841718


2 Answers

instead of

 http://localhost/xampp/htdocs/index.html

try just

http://localhost/index.html

or if index.html is saved in a folder in htdocs then

http://localhost/<folder-name>/index.html
like image 85
Shema_Thomas Avatar answered Dec 28 '22 08:12

Shema_Thomas


htdocs is your default document-root directory, so you have to use localhost/index.html to see that html file. In other words, localhost is mapped to xampp/htdocs, so index.html is at localhost itself. You can change the location of document root by modifying httpd.conf and restarting the server.

like image 21
Fr0g Avatar answered Dec 28 '22 07:12

Fr0g