WordPress Multisite Redirect Loop After Changing Domain – How to Fix too many redirects
You change the main domain of your WordPress Multisite, open the network or a subsite in the browser, and suddenly get:
- This page isn’t working
- ERR_TOO_MANY_REDIRECTS
- The site keeps bouncing between the old and new domain
This usually happens because Multisite stores the domain in multiple places. If one of them still points to the old URL, you get a redirect loop.
Let’s go through a safe, step by step way to fix it.
1. Backup before touching anything
Before you edit config files or the database, always create a backup.
- Export the database (using phpMyAdmin or your hosting panel).
- Download
wp-config.phpand.htaccess.
If anything goes wrong, you can restore the backup and start again calmly.
2. Clear browser cookies and cache first
Sometimes the redirect loop is a mix of cookies and new domain rules.
- Open the site in an incognito/private window.
- Or clear cookies for the domain in your browser.
If it magically works in incognito mode, you probably only had stale cookies. If not, continue with the next steps.
3. Set the correct domain in wp-config.php
Open wp-config.php in the root of your Multisite.
You will usually see lines like:
define( 'MULTISITE', true );
define( 'SUBDOMAIN_INSTALL', true );
define( 'DOMAIN_CURRENT_SITE', 'old-domain.com' );
define( 'PATH_CURRENT_SITE', '/' );
define( 'SITE_ID_CURRENT_SITE', 1 );
define( 'BLOG_ID_CURRENT_SITE', 1 );
Update DOMAIN_CURRENT_SITE to your new domain:
define( 'DOMAIN_CURRENT_SITE', 'new-domain.com' );
If you also moved from a subfolder to the root, adjust PATH_CURRENT_SITE:
define( 'PATH_CURRENT_SITE', '/' ); // root
// or
define( 'PATH_CURRENT_SITE', '/blog/' ); // subfolder network
Save the file and upload it back to the server if needed.
4. Update the network domain in the database
WordPress Multisite stores domain info in at least two key tables: wp_site and wp_sitemeta.
You can change these via phpMyAdmin or any SQL client.
4.1 Update wp_site
In phpMyAdmin:
- Open the database.
- Click on the
wp_sitetable (prefix may differ, e.g.wp_orwp123_). - Edit the row with
id = 1.
Set:
domain=new-domain.compath=/(or your network path)
Or run SQL:
UPDATE wp_site
SET domain = 'new-domain.com', path = '/'
WHERE id = 1;
4.2 Update wp_sitemeta siteurl
In wp_sitemeta table, find:
meta_key=siteurl
Update its meta_value to the new full URL, for example:
UPDATE wp_sitemeta
SET meta_value = 'https://new-domain.com'
WHERE meta_key = 'siteurl';
This tells the network about its new base URL.
5. Update each site’s domain in wp_blogs
If you have multiple subsites, their domains and paths live in wp_blogs.
Example:
SELECT * FROM wp_blogs;
You might see rows like:
id1: domainold-domain.com, path/id2: domainsub1.old-domain.com, path/(subdomain install)- or
id2: domainold-domain.com, path/subsite1/(subdirectory install)
Update them to the new domain:
Subdomain style:
UPDATE wp_blogs
SET domain = REPLACE(domain, 'old-domain.com', 'new-domain.com');
Subdirectory style:
Just make sure the main row has domain = 'new-domain.com', and paths stay the same.
6. Search and replace old domain in all site options
Each site in a Multisite has its own options table:
wp_1_optionswp_2_optionswp_3_options- …
In each *_options table, update:
siteurlhome
Example for the main site:
UPDATE wp_1_options
SET option_value = 'https://new-domain.com'
WHERE option_name IN ('siteurl', 'home');
For a subsite using subdirectory:
UPDATE wp_2_options
SET option_value = 'https://new-domain.com/subsite1'
WHERE option_name IN ('siteurl', 'home');
If you have many subsites, use a search/replace tool like WP-CLI or a migration plugin to replace old-domain.com with new-domain.com across the database. This also helps with widgets, menus, and internal links.
7. Check and fix .htaccess for Multisite
In Apache environments, .htaccess handles the rewrite rules. If these rules do not match your Multisite mode (subdomain vs subdirectory), you can get loops.
7.1 Subdirectory network example
For a standard subdirectory Multisite, .htaccess in the root should look like:
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
# add a rule to handle HTTP_AUTHORIZATION if you use it
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]
WordPress itself can regenerate these rules when you visit Network Admin → Settings → Network Setup, but if you are stuck in a redirect loop you can paste the correct default rules manually from the official docs.
7.2 Nginx configuration check
On Nginx, check the server block to make sure the try_files lines look similar to:
location / {
try_files $uri $uri/ /index.php?$args;
}
Avoid custom redirect rules that still point to the old domain.
8. Remove conflicting redirects at the server or CDN level
If you also set redirects in:
- Your hosting panel
- Cloudflare or another CDN
- A plugin like Redirection, Rank Math, or Yoast
they might still be redirecting to the old domain.
Check for rules like:
old-domain.com->new-domain.comhttp->https(done twice)
Stacked redirects can easily create loops.
Temporarily disable:
- Redirect plugins
- CDN page rules
Then test the site. If the loop stops, re-enable them one by one and fix any rules that still reference the old domain.
9. Clear caches everywhere
After changing URLs and rules, caches can keep the old redirects in memory.
Clear:
- WordPress caching plugins (WP Rocket, W3TC, LiteSpeed, etc.)
- Object cache (Redis, Memcached) if you use it
- Server cache (Nginx FastCGI cache, LiteSpeed cache)
- CDN cache (Cloudflare, etc.)
- Browser cache (or just use an incognito window)
Once everything is cleared, test the main site and a random subsite.
10. Quick checklist for fixing Multisite redirect loops
When your WordPress Multisite keeps redirecting after a domain change:
- Backup database and files.
- Update
DOMAIN_CURRENT_SITEandPATH_CURRENT_SITEinwp-config.php. - Fix
wp_siteandwp_sitemeta.siteurlto use the new domain. - Update
wp_blogs.domainand paths for all subsites. - Correct
siteurlandhomein every*_optionstable. - Make sure
.htaccessor Nginx rules match your Multisite type. - Remove or update any old redirects in plugins, hosting, or CDN.
- Clear all caches and test in a private browser window.
Once every reference to the old domain is cleaned up and your rewrites are correct, the redirect loop will stop and your WordPress Multisite will load normally on the new domain.