Fixing WordPress Multisite Subdomain Dashboard Redirects and 404 Errors
Content
If you've set up a WordPress Multisite network with subdomains, you might encounter a frustrating issue: clicking the "Dashboard" link for a sub-site redirects you to the wrong place—often the main site's login, an unrelated site's admin, or a 404 error page. This is a common problem discussed across various support forums, including threads about 'Networking WordPress'. Let's break down why this happens and how to fix it.
Why Do Subdomain Dashboard Redirects Happen?
Based on the analysis of common user reports, this redirect issue is rarely a bug in WordPress itself. Instead, it's almost always caused by a misconfiguration in one of three areas:
- Server (DNS & Web Server) Configuration: The wildcard subdomain DNS record (*.yourdomain.com) is missing or incorrect, or the web server (like nginx or Apache) is not properly configured to handle requests for any subdomain.
- WordPress Configuration: The values for
WP_HOMEandWP_SITEURLin the sub-site's settings or database might be incorrect, often pointing to the main domain or localhost instead of the full subdomain URL. - .htaccess Rules: The Multisite-specific rewrite rules in the
.htaccessfile might be missing, incomplete, or conflicting with other rules.
How to Troubleshoot and Fix the Redirects
Follow these steps to resolve the subdomain dashboard access problem.
1. Verify Your Wildcard DNS Record
The most common cause is a missing wildcard DNS record. A wildcard record (like *.yourdomain.com) ensures that any subdomain request is directed to your server. You must create an "A" record in your domain's DNS settings with the hostname * pointing to your server's IP address. Without this, subdomains like test.yourdomain.com cannot be resolved and will not load.
2. Check Your Web Server Configuration
Your server must be configured to accept requests for any subdomain.
- For Apache: The wildcard subdomain is usually handled by the
.htaccessfile. Ensure your.htaccessfile contains the correct Multisite rewrite rules for subdomains. The official WordPress codex provides the exact rules you need. - For nginx: Configuration happens at the server level. Your
server_namedirective must include both the main domain and the wildcard subdomain (e.g.,server_name yourdomain.com *.yourdomain.com;). You may need to contact your hosting provider or server administrator to confirm this is set up correctly.
3. Review Your WordPress Settings
Log into your network admin dashboard and navigate to My Sites > Network Admin > Sites. Edit the problematic sub-site and check these two fields:
- Site Address (URL): This must be the full subdomain URL (e.g.,
https://test.yourdomain.com). - Home: This should also be the full subdomain URL.
If these are grayed out, you may need to update them directly in the database within the wp_#_options table (or wp_options for the main site) for the specific site's siteurl and home values. Always back up your database before making changes.
4. Clear Caching and Cookies
After making configuration changes, clear your browser cache and cookies. A stubborn cached redirect or old cookie can sometimes cause persistent login loops.
When Multisite Might Not Be the Right Tool
As seen in some user reports, sometimes the underlying goal doesn't actually require a Multisite network. For example, if you simply want one domain to display the content of a page on another domain, a redirect or a simpler method might be more appropriate than creating an entirely new site within a network. The 'Networking WordPress' documentation often suggests evaluating your use case first.
Need More Help?
If you've checked all these settings and the problem persists, the issue could be more specific to your server environment. Detailed error logs from your web server can provide crucial clues. You can often find these in your hosting control panel (e.g., cPanel) or by asking your hosting provider for assistance. For further reading, the WordPress.org codex has an extensive guide on debugging a WordPress network.
Related Support Threads Support
-
Attempting to use WordPress as a headless CMS placing it behind a reverse-proxyhttps://wordpress.org/support/topic/attempting-to-use-wordpress-as-a-headless-cms-placing-it-behind-a-reverse-proxy/
-
Can’t access sub-domain dashboardhttps://wordpress.org/support/topic/cant-access-sub-domain-dashboard/
-
Multisite nginx woes – subsite goes to entirely different site’s adminhttps://wordpress.org/support/topic/multisite-nginx-woes-subsite-goes-to-entirely-different-sites-admin/
-
Can’t access subdomain dashboard in multisite network (404 error)https://wordpress.org/support/topic/cant-access-subdomain-dashboard-in-multisite-network-404-error/
-
Add second site to networkhttps://wordpress.org/support/topic/add-second-site-to-network/
-
Main WP Site Redirecting to Subdomain WP Installationhttps://wordpress.org/support/topic/main-wp-site-redirecting-to-subdomain-wp-installation/
-
No login after change from subdomain to subfolderhttps://wordpress.org/support/topic/no-login-after-change-from-subdomain-to-subfolder/
-
Multisite subdomain site on secondary domainhttps://wordpress.org/support/topic/multisite-subdomain-site-on-secondary-domain/
-
[NSFW] Redirects when going to WPMU subdomain settingshttps://wordpress.org/support/topic/redirects-when-going-to-wpmu-subdomain-settings/
-
Landingpage mit Mulitsite?https://wordpress.org/support/topic/landingpage-mit-mulitsite/
-
Multisite wordpress on a subdomain as test environmenthttps://wordpress.org/support/topic/multisite-wordpress-on-a-subdomain-as-test-environment/
-
Multisite domain mapping failure to access admin only for forwarded domainhttps://wordpress.org/support/topic/multisite-domain-mapping-failure-to-access-admin-only-for-forwarded-domain/
-
verifying a subdomain for G Suitehttps://wordpress.org/support/topic/verifying-a-subdomain-for-g-suite-2/
-
Multisite n00bhttps://wordpress.org/support/topic/multisite-n00b/
-
Multisite setup for subdomain that already existed on wordpresshttps://wordpress.org/support/topic/multisite-setup-for-subdomain-that-already-existed-on-wordpress/
-
adding another domainhttps://wordpress.org/support/topic/adding-another-domain/
-
Where is the dashboard for my addon domain?https://wordpress.org/support/topic/where-is-the-dashboard-for-my-addon-domain/
-
Redirect Errorhttps://wordpress.org/support/topic/redirect-error-37/
-
New Network, Domain Mapping OK but Dashboard not availablehttps://wordpress.org/support/topic/new-network-domain-mapping-ok-but-dashboard-not-available/
-
Issues with subdomain redirectionhttps://wordpress.org/support/topic/issues-with-subdomain-redirection/
-
local server to live server steps needed to be takenhttps://wordpress.org/support/topic/local-server-to-live-server-steps-needed-to-be-taken/
-
Domain Mapping in a subdirectoryhttps://wordpress.org/support/topic/domain-mapping-in-a-subdirectory/
-
Multisite: Dashboard link takes me back to main site URLhttps://wordpress.org/support/topic/multisite-dashboard-link-takes-me-back-to-main-site-url/
-
Move wp-admin to sub domainhttps://wordpress.org/support/topic/move-wp-admin-to-sub-domain/
-
Multisite Redirect for non logged in users but works fine on subdomainshttps://wordpress.org/support/topic/multisite-redirect-for-non-logged-in-users-but-works-fine-on-subdomains/