Axel Stone
Axel Stone

Reputation: 1580

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?

Upvotes: 5

Views: 16625

Answers (1)

Hrabosch
Hrabosch

Reputation: 1583

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.

Upvotes: 6

Related Questions