So I set a virtual host in my XAMPP 5.6.3. It should point to the document root I set there, but instead it points to htdocs. Why is that? Here is the virtual host setting:
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot "D:/htdocs/PHP projects/myproject/myproject"
ServerName myprojectlocaldev.com
ErrorLog "logs/myprojectlocaldev.com-error.log"
CustomLog "logs/myprojectlocaldev.com-access.log" common
SetEnv APPLICATION_ENV "development"
<Directory "D:/htdocs/PHP projects/myproject/myproject">
DirectoryIndex index.php
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
UPDATE
It turns out, the whole Virtual Host didn’t work, not just the DocumentRoot.
2
Answers
Windows 10 have used port 80 somewhere, so XAMPP should change Apache's port first before it can apply a virtual host.
There is also another solution. Changing the default 80 port raises a lot of issues. The problem seems to be gone when we create a local SSL certificate.