Configure apache virtual host on windows: WAMP Server

Configure apache virtual host on windows: WAMP Server

To test the domain name on your machine without a DNS, you can make the domain name redirect to localhost. all you have to do is edit the hosts file with admin privileges.

#rest of file
127.0.0.1 test.yamicode.com

To Configure a virtual host on apache.

#rest of file
<VirtualHost *:80>
  ServerName yamicode.com
  ServerAlias test.yamicode.com
  DocumentRoot "${INSTALL_DIR}/www/yamitest"
  <Directory "${INSTALL_DIR}/www/yamitest/">
    Options +Indexes +Includes +FollowSymLinks +MultiViews
    AllowOverride All
    Require local
  </Directory>
</VirtualHost>

After httpd-vhosts.conf modification you should always restart apache

the path of httpd-vhosts.conf can change based on your apache directory (path\to\apache\conf\extra\httpd-vhosts.conf).

If it's not working check that the file is imported in path\to\apache\conf\httpd.conf

# Virtual hosts
Include conf/extra/httpd-vhosts.conf