Fun with Permalinks
Wednesday, April 9th, 2008The two or three of you out there who do read my blog will have been noticing some rather frustrating problems. They are all my fault. I apologize. Here’s what happened, just to explain and to make sure I don’t make the mistake again.
I recently upgraded WordPress on my server from 2.3.3 to 2.5. On my server I keep the previous version in place so that I can easily roll back. I keep the WordPress installations in a directory named with the version, so right now I have wordpress_2-3-3 and wordpress_2-5. So that I don’t have to update Apache as to what version to serve, I have a symbolic link wordpress which always points to the latest version.
My upgrade procedure is:
- Copy tarball to install location
- Remove
wordpresssymbolic link - Expand the tarball; this results in a new
wordpressdirectory - Rename
wordpresstowordpress_<version>; in this case the new directory was namedwordpress_2-5 - Copy over everything that I need from the
wp-contentdirectory in the previous version to the new version - Copy
wp-config.phpfrom the old version’s directory to the new version’s directory - Reinstate the
wordpresssymbolic link, but this time point it to the new version
At this point I thought I was done. But I forgot one important little file. In order for “pretty” permalinks to work, you must give Apache some instructions. The easiest way to do this is to create a .htaccess file in the WordPress directory. If the permissions on the file are right, WordPress will even update it automatically for you when you change the Permalink setting.
So, this morning I finally realized what my problems were all about, copied that file over to the new version, and BINGO! Amazingly enough when WordPress has the correct configuration files and Apache has its correct configuration files, your blog is served correctly.
Again, I apologize to my few readers out there. I hope you haven’t already unsubscribed. Now I have documented the process and future upgrades should be less painful.