
This step is necessary to ensure that still points at XAMPP’s htdocs directory once we’ve created our custom VirtualHosts. Options Indexes FollowSymLinks Includes execCGI AllowOverride All Require all granted Towards the bottom of the file you will see some example VirtualHosts, which you should comment out or delete.Īt the bottom of the file, add ‘localhost’ as the default named VirtualHost:ĭocumentRoot "/Applications/XAMPP/xamppfiles/htdocs"

Open the file /Applications/XAMPP/xamppfiles/etc/extra/nf. Uncomment the second line by removing the hash (#), so that Apache loads your custom VirtualHosts configuration file: #Include /Applications/XAMPP/etc/extra/nf The first thing you’ll need to do is open the file /Applications/XAMPP/xamppfiles/etc/nf in your favourite text editor. To test your development site all you would need to do is plug “” into your browser’s address bar. For example, you might want to map mysite.local to /Users/yourusername/mysite. You can set up as many VirtualHosts as you need, so that each website operates under its own hostname. VirtualHosts allow Apache to map a hostname to a directory on the filesystem. Here are the steps I followed to get everything running smoothly.įirst, some quick background on what we’re trying to achieve. Installing XAMPP was a snap, but when I came to create my own Apache VirtualHosts things started getting fiddly. While I know that MAMP is very popular on Mac, I have been using XAMPP for many years so I thought I’d stick with what I know. I do all my development locally, so one of the first applications I installed was XAMPP, a cross platform Apache/MySQL/PHP stack. A few weeks back I rejoined the “Cult of Mac” when I replaced my old Asus notebook with a MacBook Pro, and since then I’ve been busy settling into my new OS X workflow.
