title: WordPress MultiSite Network Admin Redirect Loop After Adding www
body: <p>After learning that a naked WP domain will have 'cookieless subdomain' issues if a CDN is self hosted, I needed /  had to switch the root site on my <strong>MultiSite</strong> to www.</p>
  
  <p>I followed <a href="http://wordpress.org/support/topic/adding-www-to-the-domains-of-a-multisite-network" rel="nofollow">this guide</a> by:</p>
  
  <ol>
  <li><p>edit wp-config.php and change
  from
  define(‘DOMAIN_CURRENT_SITE’, ‘example.com’);
  to
  define(‘DOMAIN_CURRENT_SITE’, ‘www.example.com’);</p></li>
  <li><p>get the search &amp; replace script from <a href="https://github.com/interconnectit/Search-Replace-DB" rel="nofollow">https://github.com/interconnectit/Search-Replace-DB</a> and read the instructions on the site on how to use it.</p></li>
  </ol>
  
  <p>Everything worked as expected but for accessing the <strong>Network Admin</strong> Dashboard.</p>
  
  <p>The dashboards to all the sites (<em>uses sub-domains, not folders</em>) and the permalink structure functions properly within the root site (www.example.com) and the sub-domain sites (subdomain.example.com). But, when I try to access the <strong>Network Admin</strong> (i.e. http://www.example.com/wp-admin/network/), I get a 302 redirect loop.</p>
  
  <p><strong><em>Again, the Dashboards to all the sub-domain sites functions properly but not the Network Dashboard.</em></strong></p>
  
  <p>I done some snooping on Google and here on SO but nothing has worked ( or fits to this situation ). I think this can be fixed in the .htacces but I am not verse in that so any help or suggestions would be greatly appreciated!!</p>
  
  <p>Below is my configurations:</p>
  
  <p>.htaccess:</p>
  
  <pre><code>. . .
  # BEGIN WordPress
  
  &lt;IfModule mod_rewrite.c&gt;
  RewriteEngine On
  RewriteBase /
  RewriteRule ^index\.php$ - [L]
  
  # Disable trace and track
  RewriteCond %{REQUEST_METHOD} ^TRACE
  RewriteRule .* - [F]
  
  # Forbid Proxy comment posting
  RewriteCond %{REQUEST_METHOD} =POST
  RewriteCond %{HTTP:VIA}%{HTTP:FORWARDED}%{HTTP:USERAGENT_VIA}%{HTTP:X_FORWARDED_FOR}%{HTTP:PROXY_CONNECTION} !^$ [OR]
  RewriteCond %{HTTP:XPROXY_CONNECTION}%{HTTP:HTTP_PC_REMOTE_ADDR}%{HTTP:HTTP_CLIENT_IP} !^$
  RewriteCond %{REQUEST_URI} !^/(wp-login.php|wp-admin/|wp-content/plugins/|wp-includes/).* [NC]
  RewriteRule .* - [F,NS,L]
  
  # add a trailing slash to /wp-admin
  RewriteRule ^wp-admin$ wp-admin/ [R=301,L]
  
  RewriteCond %{REQUEST_FILENAME} -f [OR]
  RewriteCond %{REQUEST_FILENAME} -d
  RewriteRule ^ - [L]
  RewriteRule ^(wp-(content|admin|includes).*) $1 [L]
  RewriteRule ^(.*\.php)$ $1 [L]
  RewriteRule . index.php [L]
  &lt;/IfModule&gt;
  
  # END WordPress
  . . .
  </code></pre>
  
  <p>...and in my config.php:</p>
  
  <pre><code>. . .
  /* Multisite */
  define('MULTISITE', true);
  define('SUBDOMAIN_INSTALL', true);
  define('DOMAIN_CURRENT_SITE', 'www.example.com');
  define('PATH_CURRENT_SITE', '/');
  define('SITE_ID_CURRENT_SITE', 1);
  define('BLOG_ID_CURRENT_SITE', 1);
  
  define('ADMIN_COOKIE_PATH', '/');
  define('COOKIE_DOMAIN', '');
  define('COOKIEPATH', '');
  define('SITECOOKIEPATH', '');
  . . .
  </code></pre>