![]() 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. ![]() Change the other to the appropriate domain names and paths.Īnother way to copy your Multisite is to manually copy over the files, then copy the database and do a search and replace on the database as described in the Codex.When I'm developing for WordPress, I use MAMP to serve my sites locally. For your base site, change the domain to your parent site’s domain and change the path to “/”. You’ll have to fix that manually, but it’s pretty easy. Using that technique, I discovered that the plugin’s search and replace wasn’t able to fix the wp_blogs table. All the articles and posts I have found online are for earlier versions, and or dont seem to work, or require additional software. I want to be able to access it from other devices on my local network in order to test various browser / os combinations. Once copied, I went through the steps in the Codex to convert it to Multisite, and then my sub-sites showed up! I have MAMP Pro 4 running on a Macbook Pro, with virtual hosts. That involves installing WordPress and the plugin locally, then using it to pull the database, plugins, themes, and images from the site to be copied. This is a paid plugin but it’s super handy. I decided to use WP Migrate DB Pro plugin with the Multisite add-on. In either case, it’s non-trivial, so I’m leaving the details for you to find elsewhere, but I’ll tell you what I did. If you’re migrating a Multisite from somewhere else, there are many ways to do this, ranging from using a plugin to doing it by hand. At this point, the site should be broken, i.e., home page not accessible (at least that’s what happened to me). Verify that it’s working, then go through the steps in the Codex to convert it to a Multisite. If you’re starting from a clean install, go ahead and install WordPress in your development directory. ![]() Once your URLs are clean and simple, it’s time to set up WordPress. Install Your WordPress Site or Migrate it In At this point, you should have a working installation of Apache with MySQL. Unzip the packgage, double-click the installer and follow the on-screen instructions. Note, if you’re not using subdirectories for your sub sites (i.e., you’re using different domains for your sub-sites), you’ll need to enter all of those domains in your local hosts file. First, go to the official MAMP website and download your free copy of MAMP. If your URLs include the port number and/or a subdirectory as shown in the first example above, see that article, then come back when that’s all done and totally working for a regular WordPress install. I wrote a whole article on how to get clean URLs on MAMP. So, the first step is to make your local URLs “clean” like this: mysite.local After a lot of struggling and research, I came to the conclusion that it’s basically not possible to set up WordPress Multisite on a local URL like this: 127.0.0.1:8888/ ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |