Thursday, May 17, 2007

permalinks in wordpress, Apache redirection, and other blog stuff

When I first put my new blog online I didn't think to set the custom permalinks option to avoid having /index.php in all URLs (which wastes a few bytes and looks nasty).

So I decided to change to better URLs but unfortunately many people have already bookmarked the bad URLs. I wanted to give a HTTP 301 redirection when someone uses the old index.php version (so that bookmarks get updated) and then redirect to the PHP file. Unfortunately having a redirection from ^/index.php to a version without it and then a local rewrite to include index.php again doesn't seem to work (any advice would be appreciated). So I put the following in my /etc/wordpress/htaccess file (the location for such things in Debian) so that foo.php is used instead where foo.php is a sym-link to index.php. I'm wondering whether I should file a bug report against the Debian package requesting that a sym-link be in the package to facilitate such things - if it's not possible to do what I desire without the symlink.

The rest of this post is on my new blog.