Steve Taylor photo

WordPress 2.1 and .htaccess files

I’m building this site with WordPress 2.1, which has some great new features (such as post auto-saving and draft pages). I’ve heard there are significant teething problems with upgrading from a previous version – for instance, the new draft pages system means that pages are now flagged with the database field post_type being used instead of the post_status field being set to static. Much more logical, but it may break some of your page-related plugins.

Anyway, for new installs it seems like the way to go, with a few caveats. One involves the potent but potentially tricksy .htaccess file for Apache server configuration settings. If, like me, you prefer to maintain control over the file yourself instead of having WordPress automatically generate it, you might run into problems when 2.1 tries to “fix” it.

If you suddenly get a HTTP 500 error (Internal Server Error), it’s often due to slip-ups in .htaccess. If you’re using WordPress 2.1 and get this, download .htaccess and see if WP hasn’t slipped its mod_rewrite rules in at the end. If you’ve adapted the default mod_rewrite code, WP 2.1 thinks it’s not there at all, and slips the default in at the end again.

I’ve not found a way to stop WP doing this – there was a suggestion to change the write permissions on the file to stop WP accessing it, but you’d have to switch them back every time you re-uploaded the file. Pain in the arse. I’ve just reverted to keeping the default WP mod_rewrite at the end of the file, exactly as WP intends.