meyerweb.com

Skip to: site navigation/presentation
Skip to: Thoughts From Eric

Archive: 1 February 2007

Fixing My WordPress Install

Okay, so my “Whole Magilla” feeds—both full-content and summary—are working again, and the main archive page actually shows content.  The problem in both cases, as I mentioned in my previous post, was that WordPress’ code was throwing 404 responses.  In the case of the archive page, it would literally put up a 404 page generated by WordPress, instead of list the most recent posts.  For the Magilla feeds, the RSS files were being served up, but with HTTP 404 headers.  In feed readers that respected HTTP headers, like Firefox or NetNewsWire (and probably most others), that meant the feeds were broken.  Other feeds, such as the tech-only feed, were unbroken, but of course the most popular feeds are the Magilla feeds.

In the end, a post from Alex King showed me the way to a “fix”.  I put that word in quotes because this is really more of a hack.  No, actually, it’s just gross, but it works.  In order to get WP to stop throwing inappropriate 404s, I commented out lines 35 through 135 of classes.php in the WordPress core.  Here’s the beginning and end of the block I commented out:

if (! empty($rewrite)) {
   // If we match a rewrite rule, this will be cleared.
   $error = '404';

[...a ton of redacted lines...]

      $this->did_permalink = false;
   }
}

There you go: with one hundred lines of code commented out, my feeds and archive page work again.  This is not a good idea, but it’s all I could figure out to do.  Obviously, having modified a core file, I’m taking a chance that this won’t cause other problems.  So far I haven’t seen any, but you never know.  I’m also making upgrades much harder on myself, given that the new core file won’t have my modifications.

Similarly, I commented out the mod_rewrite.c block WP added to the end of my .htaccess file, so that I can use my own rewrites and not invoke WP’s rewriting.  With every upgrade, I’ll have to check that file to make sure the block didn’t get added back.

I’m mostly posting this as a reference for anyone who might run into similar problems with their WP 2.x installation.  It’s my hope that a future version of WP will offer some kind of hook or option that will let me easily disable WP’s rewriting and error handling code, since I already have a web server that’s configured to do those things for me.  I don’t mind if it’s a hook that I can address via a plugin as opposed to an option in the preferences, but I’d like to have it.  It would make WP a little more attractive to power users as well, since they’d know that they could do their own rewriting and error handling without having to fight with WP’s internals.

February 2007
SMTWTFS
January March
 123
45678910
11121314151617
18192021222324
25262728  

Archives

Feeds

Extras