Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

XAMPP - how to set root folder of website in htdocs?

I installed XAMPP and created simple website (a folder 'website' in htdocs folder) that contains a link <a href="/info">Info</a>.

If I type localhost/website in browser I get a default homepage. But if I click the link, it goes to localhost/info (which does not exist), instead of localhost/website/info. I could use <a href="/website/info">, but it would be weird to refactor all the links when changing site name.

So what is the usual setting or solution that people uses when developing sites in XAMPP?

like image 957
Incredible Avatar asked Jan 21 '17 12:01

Incredible


1 Answers

You have to change DocumentRoot in httpd.conf file to folder. In your example where you have website directory.

For more sites, you have to have more hosts and then set virtual hosts. Here is link how to do that in Win. But point is the same in all OS.

like image 171
Hrabosch Avatar answered Oct 21 '22 11:10

Hrabosch