Divi WordPress Theme
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

WordPress fix require wp-blog-header.php for subdir install causes infinite redirect

Discussion in 'Misc WordPress Requests' started by WordPress.org Forums », Feb 15, 2018.

  1. WordPress.org Forums »


    require wp-blog-header.php for subdir install causes infinite redirect, by

    I’ve had this code running on my site since 2004 in order to handle multiple WP installs that all use sub directories, based off of this article:

    /* Short and sweet */
    define('WP_USE_THEMES', true);

    if ($_SERVER['SERVER_NAME'] == "www.blade-edge.com") {
    elseif ($_SERVER['SERVER_NAME'] == "www.mseairports.com") {
    elseif ($_SERVER['SERVER_NAME'] == "www.shrewsbury-gymnastics.com") {
    elseif ($_SERVER['SERVER_NAME'] == "archive.kerbalspace.agency") {
    elseif ($_SERVER['SERVER_NAME'] == "www.kerbalspace.agency") {
    if (strlen($_GET["launch"])) {
    } else {
    header('Location: http://www.blade-edge.com/ksaredirect.asp?' . $_SERVER['QUERY_STRING']);

    Seemingly out of the blue it not longer works, and I have no idea why. I haven’t touched this file in weeks but now if you visit the link included with my post submission you’ll see an error that the page is redirecting improperly. Where is the redirect?? I do redirect with header in one case, but not when “blade-edge.com” is in the URL. If I replace the require('./blog/wp-blog-header.php'); with echo 'WTF'; then visiting http://www.blade-edge.com/ will output “WTF” to the page. So I know everything works fine up until that point when I call for the header file using require. If I take out the ‘./blog/wp-blog-header.php’ and replace it with the full path ‘http://www.blade-edge.com/blog/wp-blog-header.php’ I no longer get a redirect error but just a blank page. Interestingly, if I right-click in Firefox and choose to View Page Source it just opens a tab with another blank page. So there is some redirection going on somehow?

    I’m at a complete loss how this all broke down without me touching anything My host says all they’ve done are required Windows updates to the server.

    require wp-blog-header.php for subdir install causes infinite redirect

Share This Page

Monarch Social Sharing Plugin