![]() ![]() To edit your hosts file in vim, open your preferred terminal and enter sudo vim /etc/hosts. It's protected, so you'll likely have to use sudo to open it and enter your Mac password. ![]() The /etc/hosts file on your local machine maps custom domain names to the IP addresses. Here's how I set up MAMP with virtual hosts on my Mac: ![]() Enter virtual hosts! These allow us to serve content to multiple domain names at once. I needed a way to serve my sites locally with a base URL these relative links to resolve to. For example, on a site at localhost:8888/mysite, would link to localhost:8888/image.jpg instead of localhost:8888/mysite/image.jpg like I needed it to. I keep all my WordPress work in one folder served up by MAMP, so each site in that folder is served at localhost:8888/mysite.Īt some point I started running into problems with this URL structure, mainly because root-relative URLs would link to the wrong places. Please vote for it is you think this functionality is important.When I'm developing for WordPress, I use MAMP to serve my sites locally.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |