title: Wordpress: Move Multisite from server to localhost
body: <p>I am trying to move a deployed WordPress Multi-Site to a local environment. I backed up the server database and files. In my local environment, I created a new database and imported the backup. I also copied the server files to my local machine.</p>
  
  <p>I did these steps:</p>
  
  <ol>
  <li><p>I changed <strong>wp-config.php</strong> and updated it with the new <code>db-name</code>, <code>db-username</code>, <code>db-password</code> and set <code>define('DOMAIN_CURRENT_SITE', 'www.mysitename.com');</code> to <code>define('DOMAIN_CURRENT_SITE', 'localhost/mysitename');</code>.</p></li>
  <li><p>I changed <code>option_value</code> in the <strong>wp-option</strong> database table to point to my local address.</p></li>
  <li><p>I also deleted these lines from <strong>.htaccess</strong>: </p>
  
  <pre><code># Redirect non-www urls to www
  RewriteCond %{HTTP_HOST} !^www\.mysitename\.com
  RewriteRule (.*) http://www.mysitename.com/$1 [R=301,L]
  </code></pre></li>
  </ol>
  
  <p>But when I go to <strong>127.0.0.1/mysitename</strong> I get this error: <em>This webpage has a redirect loop</em>.</p>
  
  <p>And when I change <code>define('DOMAIN_CURRENT_SITE', 'localhost/mysitename');</code> to <code>define('DOMAIN_CURRENT_SITE', 'localhost');</code> and I go to <strong>127.0.0.1/mysitename</strong> address it shows me the <em>phpinfo()</em> page.</p>
  
  <p>How can I fix my problem?</p>
  
  <p>Please explain if I must set something in <strong>.htaccess</strong> and <strong>wp-config.php</strong> files.</p>
  
  <p>Thank you so much.</p>