In Wamp, you normally place your project files in www folder to run them. In Wamp, you normally place your project files in www folder to run them. But now, you want to organize them in a directory other than www folder, may be in git repository folder. And you also want to access it just like you do using public domain.
This method will help you to do this task.
Following are the steps to setup domain in your pc for development and testing of PHP based application.
1. Open file C:\Windows\System32\drivers\etc\hosts and add this line
2. Open file httpd.conf and activate module “vhost_alias_module” if not activated.
3. Decide VHOST FOLDER where you want to save vhost configurations in your drive and add it like this line
IncludeOptional "[VHOST FOLDER]/*"
4. Create vhost config file in VHOST FOLDER and setup following lines
<Directory "[PROJECT FOLDER]"> Options Indexes FollowSymLinks MultiViews AllowOverride all Order Deny,Allow Allow from all Require all granted </Directory> <VirtualHost *:80> ServerName yourdomain.loc ServerAlias yourdomain.loc DocumentRoot "[PROJECT FOLDER]" </VirtualHost>
5. Restart the Wamp Apache only.
6. Now access the domain “http://yourdomain.loc/” in the browser.
7. Enjoy Coding.