When developing on multi-site in our local development environment we wanted a short and easy to remember URL for each site. We will take a look on how to setup http://webfoobar and http://myotherwebsite address for our sites. The following instructions are for Windows with XAMPP web server solution stack package.
- First we will edit the C:\Windows\System32\drivers\etc\hosts file to register the URL name of each site we are developing in XAMPP and append the following codes:
127.0.0.1 webfoobar 127.0.0.1 myotherwebsite
- Append the following codes in C:\xampp\apache\conf\httpd.conf file:
<Directory "C:/xampp/htdocs/drupalsites"> Options Indexes FollowSymLinks Includes ExecCGI AllowOverride All Order allow,deny Allow from all </Directory>
- Lastly, append the following codes in C:\xampp\apache\conf\extra\httpd-vhosts.conf file:
<VirtualHost *:80> DocumentRoot "C:\xampp\htdocs\drupalsites" ServerName webfoobar </VirtualHost> <VirtualHost *:80> DocumentRoot "C:\xampp\htdocs\drupalsites" ServerName myotherwebsite </VirtualHost>
- Restart your Apache web server and you can now access http://webfoobar and http://myotherwebsite in your browser.