This method will work for xamp/wamp/lamp
<VirtualHost myWebsite.local> DocumentRoot "C:/wamp/www/php-bugs/" ServerName php-bugs.local ServerAlias php-bugs.local <Directory "C:/wamp/www/php-bugs/"> Order allow,deny Allow from all </Directory> </VirtualHost>
For DocumentRoot and Directory add your local directory For ServerName and ServerAlias give your server a name
Finally go to C:/Windows/System32/drivers/etc and open hosts file
add 127.0.0.1 php-bugs.local
and nothing else
For the finishing touch restart your server
For Multile local domain add another section of code into httpd-vhosts.conf
<VirtualHost myWebsite.local> DocumentRoot "C:/wamp/www/php-bugs2/" ServerName php-bugs.local2 ServerAlias php-bugs.local2 <Directory "C:/wamp/www/php-bugs2/"> Order allow,deny Allow from all </Directory> </VirtualHost>
and add your host into host file 127.0.0.1 php-bugs.local2