Wamp Virtual Host Not Working

WAMP Virtualhost not working with Laravel instance

The first thing you should know is that the .dev tLD is now a real tLD and has been bought by Google. So as of Chrome 63 (out since December 2017), Chrome itself will force all domains ending on .dev (and .foo) to be redirected to HTTPS via a preloaded HTTP Strict Transport Security (HSTS) header.

So we should all stop using .dev and use something else, suggestions are to use .localhost or .test.

A simple test for this would be to try using FireFox or IE instead of Chrome to access your current configured site. If it runs in another browser, some of your problem is related to the Chrome changes that redirect .dev domains automatically.

Secondly, your Virtual Host definitions are not good. For some time now in WAMPServer there has been a tool provided within WAMPServer to help you create Virtual Hosts easily and correctly. Look at the WAMPSever homepage under the Tools menu for a link called Add Virtual Host (see below).

Sample Image

All you need to do is first create the folder that you want the site to live in before running the "Add Virtual Host" tool.

I suggest you revert your httpd-vhosts.conf file back to its initial state which contains only a definition for localhost

#
# Virtual Hosts
#

<VirtualHost *:80>
ServerAdmin admin@example.com
ServerName localhost
DocumentRoot "${INSTALL_DIR}/www"
<Directory "${INSTALL_DIR}/www/">
Options +Indexes +FollowSymLinks +MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>

And then using the "Add Virtual Host" menu, create your Virtual Hosts again, but this time using paycafe.localhost for example.

WAMP virtual host error log location not working?

Change your definition of the log files to include the full path.

You might also like to add a seperate log file for the PHP error log.

ErrorLog "C:/wamp/logs/localhost-error.log"
CustomLog "C:/wamp/logs/localhost-access.log" common
php_value error_log "C:/wamp/logs/localhost.php.error.log"

and

ErrorLog "C:/wamp/logs/site.local-error.log"
CustomLog "C:/wamp/logs/site.local-access.log" common
php_value error_log "C:/wamp/logs/site.php.error.log"

WAMP Virtual Hosts Not Working

I found the answer. I forgot to add the host names in the Windows host file.



Related Topics



Leave a reply



Submit