When moving a WordPress Multisite install to a different domain (such as from a live site to localhost), there are a few steps you need to follow to ensure that the site works correctly. These include updating the database and adjusting the wp-config.php file.
Firstly, the DOMAIN_CURRENT_SITE
in your wp-config.php
file should not include ‘http://‘. It should just be the domain name, so in your case it should be ‘localhost‘.
And there are several places in the database where you need to change the domain. Do properly change them, you can use a search and replace script or you can try a search and replace plugin like this one.
Remember to clear your browser cache before testing your site on localhost, as your browser may have cached redirects to your live site.
Then, make sure your hosts file on your local machine is set up to associate localhost
with the local IP address.
If you still face issues, it might be related to your server configuration. For instance, if you’re using Apache, ensure that your vhost file is properly configured. If you’re using a tool like MAMP or XAMPP, ensure that the server software is properly configured to point to the correct directory for your site.