I'm trying to get a local copy of a website configured on my machine, using XAMPP, but I'm finding the configuration impossible.
I put all the files into a subdirectory of localhost, and browse to it as expected with /localhost/subfolder.
How can I configure XAMPP so that instead of URLs pointing to /localhost/page.php and CSS pointing to /localhost/style.css etc, they point correctly to /localhost/subfolder/page.php and /localhost/subfolder/style.css.
It strikes me as something that should be simple, straightforward and sensible to do. But as yet, I have found no way to do this.
I have tried configuring VirtualHosts, and using .htaccess rules, but nothing works.
I do not want to dump all the site files directly into /localhost. That does not seem like it should be the only solution.
Any help would be greatly appreciated, and apologies if this has been asked before. I have looked, but I didn't find anything that matched this problem.