I have a site at www.badname.com that uses www.goodname.com as a proxy. A rewriterule makes it look for the visitor as if they’re visiting www.goodname.com, while the actual WordPress site is hosted at www.badname.com.
Now to the problem: If I configure WordPress to use www.goodname.com as the WordPress site address, then the site gets stuck in an infinite redirect loop (because goodname.com redirects to badname.com and vice versa).
If I configure WordPress to use www.badname.com as the site address, then everything works, but all the internal links on the site (menus, images, alternate links, pingback, etc) will lead to www.badname.com, which is not what I want.
Now, I could add filters to functions.php and change every single function that creates links, swapping out “badname” for “goodname”, but it feels like there should be a simpler way to do it, perhaps by keeping www.goodname.com as the WordPress site address but editing whichever part of WordPress that is causing the redirects.
Does anyone know what part of WordPress is causing the redirects, or have any other ideas or tips? Maybe there’s some simple solution I haven’t thought of.