- #Add url to alias mamp pro how to#
- #Add url to alias mamp pro pro#
- #Add url to alias mamp pro password#
So that your changes take effect, restart Apache. Save the host file using the key combo control+o, and pressing return when prompted to choose the filename. Use your keyboard’s arrow keys to navigate to the bottom of the file and add your own mapping: # XAMPP VirtualHost mappings You’ll see that the hosts file already contains some default hostname mappings (e.g.
#Add url to alias mamp pro password#
In this case we want to map your new ServerName to the IP address 127.0.0.1, which is your localhost.įire up a Terminal instance, and at the prompt type the following command: sudo nano /etc/hostsĮnter your OS X password when prompted, and the hosts file will be opened in the nano text editor. The hosts file is used by OS X to map hostnames to IP addresses.
#Add url to alias mamp pro how to#
Once you’ve saved your nf and nf files, the next step is to edit your OS X hosts file so it knows how to handle your new ServerName. If your path includes spaces, make sure you enclose it in quotes, like in my example. I store most of my sites inside of Dropbox so that I can access them on both my home and work machines. The path to your website can point at any folder in your OS X user directory. local extension makes it obvious that the site is hosted locally rather than on a public web server. This can be anything you wish, but make sure you choose a hostname that won’t conflict with a real domain name. In the above example you should replace “mysite.local” with your own hostname. Options Indexes FollowSymLinks Includes ExecCGI After the default localhost that you just created, add: # My custom hostĭocumentRoot "/Users/yourusername/path/to/your/site" Now you are ready to create your own VirtualHosts. Personally I don’t use the htdocs directory a lot, but occasionally it’s useful to have somewhere to perform quick tests. This step is necessary to ensure that still points at XAMPP’s htdocs directory once we’ve created our custom VirtualHosts.
![add url to alias mamp pro add url to alias mamp pro](https://documentation.mamp.info/en/MAMP-PRO-Mac/Create-a-new-host/Import/Create-a-new-Import-host-14.png)
Options Indexes FollowSymLinks Includes execCGI 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: # localhostĭocumentRoot "/Applications/XAMPP/xamppfiles/htdocs" Open the file /Applications/XAMPP/xamppfiles/etc/extra/nf.
![add url to alias mamp pro add url to alias mamp pro](https://documentation-4.mamp.info/en/MAMP-PRO-Mac/How-Tos/General/addToTemplate.png)
Include /Applications/XAMPP/etc/extra/nf Create your VirtualHosts Uncomment the second line by removing the hash ( #), so that Apache loads your custom VirtualHosts configuration file: # Virtual hosts
![add url to alias mamp pro add url to alias mamp pro](https://mampsupportforum.com/images/mamppro-forum-icon.png)
#Include /Applications/XAMPP/etc/extra/nf Look for the following lines: # Virtual hosts 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. Typing subdomain.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.
![add url to alias mamp pro add url to alias mamp pro](https://www.mamp.info/en/mamp-pro/mac/screenshots/MAMP-PRO-Standard-view-Hosts.png)
(I develop in one folder called ‘code’ and in that I have a new folder for each sub-domain) now, create another new host that you will use to map for your subdomain, choosing a new disk location whilst you’re there.choose a Disk Location for this new host, and a server name, say: mydomain.open Mamp PRO, click hosts and create a new host that you will use to map for your primary domain.So, to create and use sub-domains with MAMP Pro, follow these simple enough steps: Mark obviously hasn’t had the time, so I wanted to jot down these notes for anybody they might help. Meanwhile, in the comments were requests for the step by step to be written up. Although this task is actually quite straightforward in the end, I couldn’t find any decent documentation on it until coming across an article by Mark Van Der Putten that got me going in the right direction.
#Add url to alias mamp pro pro#
This weekend I was trying to set up subdomains in MAMP Pro to replicate the server set up for a new project I’ve taken on.