'Changing DocumentRoot on XAMPP on Windows 10 causes Error 403

When changing the Apache DocumentRoot (<Directory...> in httpd.conf to serve another directory instead of the default C:/xammp/htdocs, I get 403 error (access forbidden).

I have tried setting the "Require all granted" option as suggested in other posts (aware of the security implications, just for testing...), and I also made sure Everyone has reading rights to the folder (but I think this is less of an issue on Windows than on Linux), however it still does not work.



Solution 1:[1]

As it turns out, I was trying to access the server on https. http://localhost worked just fine. To make it work on HTTPS, apart from the httpd.conf, I also had to edit the http-ssl.conf:

<VirtualHost _default_:443>
DocumentRoot "C:/your-directory"

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Dharman