Fixing WordPress Multisite Redirects: A Troubleshooting Guide
Content
WordPress Multisite is a powerful tool for managing multiple websites from a single installation. However, one of the most common and frustrating issues users encounter is incorrect URL redirection. Instead of landing on the correct subsite, visitors—and even administrators—are often redirected to the main network site, a signup page, or a 404 error.
Why Do Multisite Redirects Happen?
Based on community reports, these redirect errors are rarely caused by a single "bug" in WordPress core. Instead, they typically stem from a misconfiguration in one of several areas:
- Domain Mapping Setup: The built-in domain mapping feature requires precise configuration in WordPress and correct DNS records at your hosting provider.
- www vs. non-www Mismatch: If a subsite's "Site Address (URL)" is set to
https://www.example.combut a user visitshttps://example.com(or vice versa), WordPress may not recognize it as a valid site in the network and redirect to the main site. - Subdomain/Subdirectory Configuration: The entire network is defined at installation as either a subdomain or subdirectory setup. You cannot mix them; a subdomain network cannot host a subdirectory site without complex rewriting rules that often cause cookie and login loops.
- Caching Issues: Aggressive object caching (e.g., Redis) or browser/DNS caching can serve old, incorrect redirects.
- Manual Database Changes: Manually changing site URLs in the database without updating all necessary records can break the site's registration within the network.
Common Solutions to Try
1. Standardize Your www Usage
A recurring theme in the support threads is inconsistency with www. The solution is often to enforce one version.
- In WordPress: Ensure the "Site Address (URL)" for every site in Network Admin -> Sites -> Edit Site uses the exact same protocol and www-preference (e.g., all
https://www.example.comor allhttps://example.com). - In .htaccess (Apache): Use server-level redirects to enforce your chosen standard before the request is processed by WordPress. This is often the most reliable method.
# Force www
RewriteCond %{HTTP_HOST} ^example.com [NC]
RewriteRule ^(.*)$ https://www.example.com/$1 [L,R=301]
# Force non-www
RewriteCond %{HTTP_HOST} ^www.example.com [NC]
RewriteRule ^(.*)$ https://example.com/$1 [L,R=301]
2. Verify Domain Mapping Configuration
If you are using WordPress's native domain mapping for a subsite:
- Set the DNS: Point your custom domain's A record to your server's IP address at your domain registrar. This is a critical step often missed.
- Set the Site Address: In Network Admin -> Sites -> Edit Site, change the "Site Address (URL)" to the full custom domain (e.g.,
https://mycustomdomain.com). - Check the Server: Ensure your web server (e.g., Apache/Nginx) is configured to accept requests for that custom domain and direct them to the WordPress installation.
3. Clear All Caches
If a configuration change doesn't take effect immediately, clear these caches:
- Browser Cache: Hard refresh (Ctrl+F5) or clear your browser's history and cached images.
- DNS Cache: Flush your local DNS cache or use a different network to test.
- Object Cache: If you use Redis or Memcached, flush it from your hosting panel or using a plugin.
- WordPress Cache: Clear any caching plugin(s) you have running.
4. Check Your .htaccess File
An incorrect or outdated .htaccess file is a common culprit. For a subdomain Multisite install, ensure your file contains the standard WordPress Multisite rules. Do not add complex rewrite rules for subdomain-to-folder paths on a subdomain network, as this will cause conflicts.
5. Re-save Permalinks
Sometimes, a simple fix is to visit Settings -> Permalinks on the affected subsite and click "Save Changes" to refresh the rewrite rules.
When to Seek Further Help
If these steps don't resolve the issue, the problem may be more complex, such as a plugin conflict (e.g., a deprecated domain mapping plugin) or a deep database inconsistency. In these cases, enabling WP_DEBUG in your wp-config.php file can reveal underlying errors. The broader WordPress community, on forums or development blogs, can often provide guidance for these edge cases.
Related Support Threads Support
-
Multisite redirecthttps://wordpress.org/support/topic/multisite-redirect/
-
Redirect the main site homepage to subfolder sitehttps://wordpress.org/support/topic/redirect-the-main-site-homepage-to-subfolder-site/
-
Display subdomain data on main domainhttps://wordpress.org/support/topic/display-subdomain-data-on-main-domain/
-
domain Alias redirecting to /wp-signup?newhttps://wordpress.org/support/topic/domain-alias-redirecting-to-wp-signupnew/
-
multisite non www links redirects to main sitehttps://wordpress.org/support/topic/multisite-non-www-links-redirects-to-main-site/
-
Single thank you page URL on Multisitehttps://wordpress.org/support/topic/single-thank-you-page-url-on-multisite/
-
Certain actions redirect to the main site’s home pagehttps://wordpress.org/support/topic/certain-actions-redirect-to-the-main-sites-home-page/
-
Multisite sub domaine linkshttps://wordpress.org/support/topic/multisite-sub-domaine-links/
-
how to map a domain with both www & non-www versionhttps://wordpress.org/support/topic/how-to-map-a-domain-with-both-www-non-www-version/
-
WPMU – Changed domain name, can’t access plugins, sites, etc.https://wordpress.org/support/topic/wpmu-changed-domain-name-cant-access-plugins-sites-etc/
-
WP Network: Change subdomain to domainhttps://wordpress.org/support/topic/wp-network-change-subdomain-to-domain/
-
One website URL redirects to another website (Multisite configuration)https://wordpress.org/support/topic/one-website-url-redirects-to-another-website-multisite-configuration/
-
Redirecting users to a specific location site they previously visitedhttps://wordpress.org/support/topic/redirecting-users-to-a-specific-location-site-they-previously-visited/
-
Domain mapping to subsite in subdirectory for 301s link preservinghttps://wordpress.org/support/topic/domain-mapping-to-subsite-in-subdirectory-for-301s-link-preserving/
-
from multisite to single sitehttps://wordpress.org/support/topic/from-multisite-to-single-site-2/
-
WordPress Multisite keeps redirecting subsite as if it doesn’t existhttps://wordpress.org/support/topic/wordpress-multisite-keeps-redirecting-subsite-as-if-it-doesnt-exist/
-
After Multisite migration – Sites go to 404 pageshttps://wordpress.org/support/topic/after-multisite-migration-sites-go-to-404-pages/
-
Multisite sites names and URLs changed to primary sitehttps://wordpress.org/support/topic/multisite-sites-names-and-urls-changed-to-primary-site/
-
Multisite, redirect sub folders on primary domain to the mapped domainshttps://wordpress.org/support/topic/multisite-redirect-sub-folders-on-primary-domain-to-the-mapped-domains/
-
Change main domain in multisitehttps://wordpress.org/support/topic/change-main-domain-in-multisite/
-
Two URL:s are not working in multisitehttps://wordpress.org/support/topic/two-urls-are-not-working-in-multisite/
-
WP Multisite Subsite non-www to www redirect not workinghttps://wordpress.org/support/topic/wp-multisite-subsite-non-www-to-www-redirect-not-working/
-
Domain mapping multisite subdirectory- get_sites() returns emptyhttps://wordpress.org/support/topic/domain-mapping-multisite-subdirectory-get_sites-returns-empty/
-
Redirect only main domainhttps://wordpress.org/support/topic/redirect-only-main-domain/
-
secondary site on multisite keeps redirecting to main sitehttps://wordpress.org/support/topic/secondary-site-on-multisite-keeps-redirecting-to-main-site/
-
Subdirectory multisite mappinghttps://wordpress.org/support/topic/subdirectory-multisite-mapping/
-
Ensure subdomains redirect to matching site addresshttps://wordpress.org/support/topic/multisite-ensure-subdomains-redirect-to-matching-site-address/
-
Multisite network problemshttps://wordpress.org/support/topic/multisite-network-problems/
-
site redirects to multiste mainhttps://wordpress.org/support/topic/site-redirects-to-multiste-main/
-
How to change subsite urlhttps://wordpress.org/support/topic/how-to-change-subsite-url/
-
href=”/ links going to main domain and not subdirectoryhttps://wordpress.org/support/topic/href-links-going-to-main-domain-and-not-subdirectory/
-
Multisite, can’t recover origin subdomain site with navigation linkshttps://wordpress.org/support/topic/multisite-cant-recover-origin-subdomain-site-with-navigation-links/
-
Subsite redirects to main site, unless httpshttps://wordpress.org/support/topic/subsite-redirects-to-main-site-unless-https/
-
Multisite password reset URL on subsitehttps://wordpress.org/support/topic/multisite-password-reset-url-on-subsite/
-
Domain Mapping in Multisiteshttps://wordpress.org/support/topic/domain-mapping-in-multisites/
-
Redirect to main site’s sign-up for a renamed subdomainhttps://wordpress.org/support/topic/redirect-to-main-sites-sign-up-for-a-renamed-subdomain/
-
Redirect preventing Network Admin page accesshttps://wordpress.org/support/topic/redirect-preventing-network-admin-page-access/
-
Multisite domain mapping redirects to main sitehttps://wordpress.org/support/topic/multisite-domain-mapping-redirects-to-main-site/
-
One of my subsites forwards to another of my subsites by mistakehttps://wordpress.org/support/topic/one-of-my-subsites-forwards-to-another-of-my-subsites-by-mistake/
-
Redirect to subsiteshttps://wordpress.org/support/topic/redirect-to-subsites/
-
Multisite URL redirect via htaccesshttps://wordpress.org/support/topic/multisite-url-redirect-via-htaccess/
-
HELP! One Multisite url not working when removing www.https://wordpress.org/support/topic/help-one-multisite-url-not-working-when-removing-www/
-
Custom Domain of Subsite Redirecting to Main Sitehttps://wordpress.org/support/topic/custom-domain-of-subsite-redirecting-to-main-site/
-
Multisite: subdirectories redirect to top directoryhttps://wordpress.org/support/topic/multisite-subdirectories-redirect-to-top-directory/
-
Wrong multisite is showing when using www.https://wordpress.org/support/topic/wrong-multisite-is-showing-when-using-www/
-
Native Domain Mapping Only Working for Either WWW or non-WWW – Not Bothhttps://wordpress.org/support/topic/native-domain-mapping-only-working-for-either-both-www-and-non-www-not-both/
-
Force redirect on subdirectory with installed Multisite WPhttps://wordpress.org/support/topic/force-redirect-on-subdirectory-with-installed-multisite-wp/
-
url keeps redirecting to old url with 404 errorhttps://wordpress.org/support/topic/url-keeps-redirecting-to-old-url-with-404-error/
-
All multisite invalid urls redirect to the main sitehttps://wordpress.org/support/topic/all-multisite-invalid-urls-redirects-to-the-main-site/