skip to Main Content

OS: Microsoft Windows 10

backend framework: Laravel

my goal: when I access to "http://example.domain", it can direct to laravel index.php.

httpd-vhosts.conf:

<VirtualHost *:80>
    DocumentRoot "C:Apache24htdocsNKUST_foodpandapublic"
    DirectoryIndex index.php
    ServerName example.domain
    ErrorLog "C:Apache24logserror.log"
    CustomLog "C:Apache24logsaccess.log" combined
    <Directory "C:Apache24htdocsNKUST_foodpandapublic"> 
        Options FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>

I save httpd-vhosts.conf and restart my apache, and now, when I access to "http://example.domain", it will direct to "C:Apache24htdocs", not "C:Apache24htdocsNKUST_foodpandapublic".

2

Answers


  1. Chosen as BEST ANSWER

    If you want to set a newer setup in "httpd-vhosts.conf", you have to delete comment out "Include conf/extra/httpd-vhosts.conf" in "httpd.conf".

    I have not notice this problem, I comment out "Include conf/extra/httpd-vhosts.conf" and set something in "httpd-vhosts.conf" at the same time, so "httpd-vhosts.conf" doesn't work.


  2. I have tried with same possible scenario as yours with following entry httpd-vhost.conf. Checked it with both ” and ‘/’ and it is working for me. Make sure to provide proper permission to your directories. If this could not work you need to provide more info.

        <VirtualHost example.domain:80>
          DocumentRoot "C:Apache24htdocsNKUST_foodpandapublic"
          DirectoryIndex index.html
          ServerName example.domain
          ErrorLog "C:Apache24logserror.log"
          CustomLog "C:Apache24logsaccess.log" combined
          <Directory "C:Apache24htdocsNKUST_foodpandapublic"> 
            Options FollowSymLinks
            AllowOverride All
            Require all granted
          </Directory>
        </VirtualHost>
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search