After banging my head on this for a few days, I found a solution that works.
Just add the following to wp-config.php:
if ( isset( $_SERVER['HTTP_X_FORWARDED_HOST'] ) ) {
$_SERVER['HTTP_HOST'] = $_SERVER['HTTP_X_FORWARDED_HOST'];
}
This will force WordPress to use the requested domain, instead of the proxy domain.
Related Posts:
- htaccess – Redirect to subfolder without changing browser URL
- WordPress Multisite – Multiple subfolders for blogs
- How to disable the default WordPress redirect to non-www URLs?
- ReWriteRules and WordPress Multi-Sites with Sub Directories
- Wrong Redirect/Rewrite Rules?
- How to Force WWW. in Domain With WordPress MU Domain Mapping Plugin?
- WordPress 3.0 Multisite – Child sites and backends appearing blank
- The wp-admin url for each site does not work on WordPress multisite
- Generic htaccess redirect www to non-www
- Redirect Main Site to Subsite in Multisite WordPress
- Multisite Network Port Num Issues?
- Why is WordPress Multisite redirecting to wp-signup.php and how to fix it?
- Making a plugin file accessible via url rewrite?
- Multisite htaccess on localhost with WP as an SVN external?
- WordPress Subdomain MultiSite on localhost XAMPP on :8080 with IIS taking port 80
- How to disable Multisite sign-up page?
- How to change default page slug?
- How to modify author base slug with groups and slug to use nice_nickname?
- WordPress multisite,several different languages,page redirect?
- WordPress multisite subdirectory redirect infinite loop issue
- Multisite 404 errors and non-www redirecting to home page
- multisite htaccess 301 redirects
- Multisite wordpress and subdomain URL collisions
- Using separate Apache log files for multisite
- Sub domain redirection to taxonomy
- Error 101 after upgrading WordPress
- W3 Total Cache Plugin with WP 3 MultiUser [closed]
- Redirect all users, except network administrators, from the main site to a subsite
- Multisite wp-admin redirect loop
- Multisite non-www domain redirects to sign-up
- WordPress network (multisite) /wp-admin/ redirect loop (ERR_TOO_MANY_REDIRECTS)
- Domain redirect in WordPress multisite
- Multisite – Redirect All Users to Subsite Home Page on Subsite Login
- Multisite non www domain gives registration error but should redirect to www.domain.com
- 301 Redirects for posts, category, pages from original domain to sub-domain of multisite
- Migrating WPMS from apache to IIS7 causes Database Error
- Trying to access second site dashboard on a multisite configuration proceeds to an error
- Redirect loop (only for multisite network admin)
- Rewrite rules in multisite
- add_rewrite_rule not registering on Multisite
- Why wordpress multisite redirect to wp-signup if site exists?
- Add Rewrite Rule to point to a file on the server
- .htaccess 301 vs. 302 Enforcing HTTPS
- Sub-subdomain getting redirected to main domain
- Members area with externally-managed htaccess / htpasswd authentication?
- Multisite network admin – URL / redirect error
- Alias domain to Multi-site installation in Apache
- How to exclude a directory from WordPress permalinks in a Multisite environment?
- Subdirectory multisite installation with several domain names?
- Redirect subdomain homepage to domain specific page in wordpress multisite
- Custom rewrite rule sends 404 header on multisite
- WordPress multisite subdirectory on nginx behind reverse proxy
- wordpress multisite subsite rewrite rules not working for videos
- Multisite Redirect issue
- How to Redirect login User with Mapped Domiain Primary blog Url to Original Sub-site Url
- Disable domain redirect
- Redirect users on logout
- Multisite, multiple domains per site
- Multisite Network menu links not updating
- https redirect hell (adding www)
- Auto Redirect after login
- WPMU Development Environment
- Domain name in a WordPress Network
- Redirect subdomain in Multisite installation?
- Issue with htaccess redirection in WP Multisite
- Site kit Google Analytics setup giving Error: {“error”:”invalid ‘redirect_uri'”}
- All pages have 302 redirect, which I can’t remove
- Why my deleted url is redirecting to random post?
- Redirect only posts to New Domain
- Multsite redirecting to the main site
- Multisite setup help – plain domain/subsite always redirects to domain with subdir multisite
- Add additional non-rewrite .htaccess directives on multisites via mod_rewrite_rules filter
- web.config breaks the themes for sub-directory multisite
- Redirect & permalink problems after moving multisite to a new server
- Temp URL Redirect Loop
- Installed domain-based Multisite but can’t access wp-admin (redirect loop)
- Redirect Site Geologically
- WordPress Multisite Strange Redirect on Primary Site
- .htaccess rules for blocking bots with an extra condition
- How to remove wordpress directory slash
- Multisite gives Error if i want to enter Dashboard or Site
- Htaccess file isn’t redirecting http sub-pages to https––they display 404 error instead, tried many solutions and none work
- WordPress Multi-Site on Ubuntu 18.04 LAMP Keeps Re-Directing
- Change pagination url format
- Apache Site Aliases & WordPress Multisite
- URL redirect/rewrite rule wordpress multisite
- How to redirect specific URL to Subdomain
- URL without www redirect directly with submission page – Multiwordpress install
- Multisite Redirection to new domains
- WordPress rewrite multisite blog url
- Nginx config, how can I redirect primary multisite domain, but not its sub-folders, nor other domains?
- Redirect One Multisite to Another
- Site redirecting to http://example.com/wp-signup.php?new=example.com
- WordPress Multisite + Erros with URLS and ADMIN
- Redirect old uploads after moving to multisite
- 301’s not working with multisite
- Multisite, Subdomain, shared NFS directory Linux HELP
- WordPress: how to change URL for individual MultiSites?
- Nginx — WordPress multisite with root folder in own directory
- How to split existing blog into WordPress Multisites without breaking links?