Making wordpress play nicely at the root

If anyone has had trouble with my site lately, I apologize.

I’ve had this ongoing problem with the default .htaccess file provided by WordPress 2.0. It wants to match every incoming URL either to a wordpress page or to a 404 document. Since I use directives in the configuration file to map to things (like trac) that have no ‘real’ filesystem location, and directives (and, by extension, their .htaccess rules) take precedence over directives, I was always getting 404’s for these virtual locations.
I spent a rediculous amount of time trying to get the Location directive to be handled; as close as I came was trying to use RewriteCond to check for a valid URL. I think, in the end of it all, there’s a problem with the way that RewriteCond handles the -u flag; I expected a “valid url” to include Location-registered urls, which the documentation implies but apparently is not the behaviour (on Apache 2.0.55) I get.
Anyway, finally I gave up: I added

ErrorDocument 404 /index.php

to the VirtualHost. This kinda sucks because it means every permalink falls all the way through the url-mapping process before finally being rendered, but at least it means that pages render properly and my virtual sub-paths work.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s