The best way to run multiple local sites with the root url instead of full path is this:
hosts
First, you need to edit your hosts file on the server. This will map the virtual host name to an IP address. To keep this simple, we'll map 127.0.0.1 to mysite. Here's how:
- Open Notepad as the administrator.
- Open the file C:\Windows\system32\drivers\etc\hosts.
- Add the line: 127.0.0.1 mysite1.dev
- Add the line: 127.0.0.1 mysite2.dev
- Add the line: 127.0.0.1 mysite3.dev
- Save the host file (making sure to not save it as a .txt file).
vhosts
Then, in your httpd-vhosts.conf file:
<VirtualHost *:80>
ServerAdmin emailaddress@domain.com
DocumentRoot "c:\MYSITE1"
ServerName mysite1.dev
ErrorLog "logs/mysite1.log"
CustomLog "logs/mysite1-access.log" common
</VirtualHost>
<VirtualHost *:80>
ServerAdmin emailaddress@domain.com
DocumentRoot "c:\MYSITE2"
ServerName mysite2.dev
ErrorLog "logs/mysite2.log"
CustomLog "logs/mysite2-access.log" common
</VirtualHost>
<VirtualHost *:80>
ServerAdmin emailaddress@domain.com
DocumentRoot "c:\MYSITE3"
ServerName mysite3.dev
ErrorLog "logs/mysite3.log"
CustomLog "logs/mysite3-access.log" common
</VirtualHost>
Here is a link with very clear instructions - Link to Create Virtual Hosts