skip to Main Content

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


  1. Chosen as BEST ANSWER

    Windows 10 have used port 80 somewhere, so XAMPP should change Apache's port first before it can apply a virtual host.


  2. 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.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search