Revision 364 is a pre-publication revision. (Viewing current revision instead.)

Resolving The WordPress Multisite Redirect Loop

Taken from Tom McFarlin. Though I do the majority of my work using single site WordPress installs, there are a number of sites and projects in which I’ve used WordPress multisite and there’s a problem that I’ve experienced specifically with using WordPress multisite, subdomains, and shared hosting environments. Specifically, the problem is this:
  • Install WordPress and activate multisite
  • Configure the installation to use subdomains (versus subdirectories)
  • Attempt to login and get stuck in a redirect loop
If you have a single instance of WordPress multisite installed on the same server, there’s no issue, but if you go beyond that then you normally hit a problem: a redirect loop.

The WordPress Multisite Redirect Loop

Once you’ve increased the number of your multisite installs beyond one, then you’re likely to be unable to login as you’ll get stuck in a redirect loop. That is, every time you try to login, you’re returned to the login screen. Luckily, the fix is relatively easy. In your wp-config.php file, add the following lines of code: [php] define('ADMIN_COOKIE_PATH', '/'); define('COOKIE_DOMAIN', ''); define('COOKIEPATH', ''); define('SITECOOKIEPATH', ''); [/php] Just make sure you put this above: /* That's all, stop editing! Happy blogging. */

Revisions

  • February 22, 2013 @ 05:39:57 [Current Revision] by PeterLugg
  • February 22, 2013 @ 05:35:12 by PeterLugg

Revision Differences

February 22, 2013 @ 05:35:12Current Revision
Content
 Added: Taken from <a href="http:// tommcfarlin.com/resolving- the-wordpress- multisite-redirect- loop/#more-4699" target="_blank">Tom McFarlin</a>.
 Added: Though I do the majority of my work using single site WordPress installs, there are a number of sites and projects in which I’ve used WordPress multisite and there’s a problem that I’ve experienced specifically with using WordPress multisite, subdomains, and shared hosting environments.
 Added: Specifically, the problem is this:
Deleted: Added: <ul>
 Added: <li>Install WordPress and activate multisite</li>
 Added: <li>Configure the installation to use subdomains (versus subdirectories)</li>
 Added: <li>Attempt to login and get stuck in a redirect loop</li>
 Added: </ul>
 Added: If you have a single instance of WordPress multisite installed on the same server, there’s no issue, but if you go beyond that then you normally hit a problem: a redirect loop.
 Added: <h2>The WordPress Multisite Redirect Loop</h2>
 Added: Once you’ve increased the number of your multisite installs beyond one, then you’re likely to be unable to login as you’ll get stuck in a redirect loop. That is, every time you try to login, you’re returned to the login screen.
 Added: Luckily, the fix is relatively easy.
 Added: In your <code>wp- config.php</code> file, add the following lines of code:
 Added: [php]
 Added: define('ADMIN_ COOKIE_PATH', '/');
 Added: define('COOKIE_DOMAIN', '');
 Added: define('COOKIEPATH', '');
 Added: define('SITECOOKIEPATH', '');
 Added: [/php]
 Added: Just make sure you put this above: /* That's all, stop editing! Happy blogging. */
 Added: <div></div>

Note: Spaces may be added to comparison text to allow better line wrapping.

Tags: , ,

No comments yet.

Leave a Reply