Knowledgebase

WordPress Multisite Redirect Loop

A redirect loop in a WordPress Multisite installation can be caused by a few different factors. Here are steps you can take to address this issue:

  1. Check wp-config.php:

    • Ensure that your wp-config.php file contains the correct settings for Multisite. The relevant lines should look like this:
    php

 

  • define('MULTISITE', true); define('SUBDOMAIN_INSTALL', false); // Set to true if using subdomains define('DOMAIN_CURRENT_SITE', 'yourdomain.com'); define('PATH_CURRENT_SITE', '/'); define('SITE_ID_CURRENT_SITE', 1); define('BLOG_ID_CURRENT_SITE', 1);
  • Check .htaccess File:

    • Make sure that the .htaccess file in your WordPress root directory has the correct Multisite rules. It should look something like this:
    apache

 

  1. RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] # add a trailing slash to /wp-admin RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L] RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^ - [L] RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L] RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L] RewriteRule . index.php [L]
  2. Check Domain Settings in Network Admin:

    • Go to the Network Admin dashboard, then navigate to "Sites" > "All Sites". Check that the domain settings for each site are correct.
  3. Check Subdomain/Subdirectory Settings:

    • Depending on your setup, ensure that you've chosen the right option for subdomains or subdirectories in the Multisite settings.
  4. Check DNS Settings:

    • If you're using subdomains, ensure that your DNS settings are configured correctly to point to your server.
  5. Check for Conflicting Plugins or Themes:

    • Deactivate all plugins and switch to a default theme (like Twenty Twenty-One). If the redirect loop disappears, reactivate each plugin and theme one by one to identify the conflicting one.
  6. Check Server Configuration:

    • Contact your hosting provider to ensure there are no server-level restrictions or configurations causing the issue.
  7. Check for ModSecurity Rules:

    • If your server has ModSecurity enabled, it might be blocking certain requests. Contact your hosting provider to review ModSecurity rules.
  8. Inspect Server Logs:

    • Review your server's error logs for any specific information about the redirect loop. This can provide more context on what's causing the problem.
  9. Check for HTTPS/SSL Configuration:

    • If you're using SSL, make sure it's properly configured. Ensure that your site URLs (in the WordPress settings) use HTTPS.
  10. Check for Incorrect .htaccess Rules:

    • Review the .htaccess file for any incorrect or conflicting rules.
  11. Contact Hosting Support:

    • If none of the above steps work, contact your hosting provider's support team. They can review server configurations and logs to identify and resolve the issue.

Remember to always back up your site before making any significant changes. This allows you to revert back if any further issues arise.

  • 0 Users Found This Useful
Was this answer helpful?