require wp-blog-header.php for subdir install causes infinite redirect
-
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:
<?php /* Short and sweet */ define('WP_USE_THEMES', true); if ($_SERVER['SERVER_NAME'] == "www.blade-edge.com") { require('./blog/wp-blog-header.php'); } elseif ($_SERVER['SERVER_NAME'] == "www.mseairports.com") { require('./mseairports/wp-blog-header.php'); } elseif ($_SERVER['SERVER_NAME'] == "www.shrewsbury-gymnastics.com") { require('./shrewsburygym/wp-blog-header.php'); } elseif ($_SERVER['SERVER_NAME'] == "archive.kerbalspace.agency") { require('./ksa_archive/wp-blog-header.php'); } elseif ($_SERVER['SERVER_NAME'] == "www.kerbalspace.agency") { if (strlen($_GET["launch"])) { require('./ksa/wp-blog-header.php'); } else { header('Location: https://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 therequire('./blog/wp-blog-header.php');
withecho 'WTF';
then visiting https://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 usingrequire
. If I take out the ‘./blog/wp-blog-header.php’ and replace it with the full path ‘https://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.
The page I need help with: [log in to see the link]
- The topic ‘require wp-blog-header.php for subdir install causes infinite redirect’ is closed to new replies.