WordPress allows posts to have pretty permalinks, but they don’t work right out of the box. Permalinks of this form perform much better in search engines. I had to fiddle with some Unix permissions and some Apache configs to get them working correctly, so I thought I’d share my experience. While working through this, I commonly got 404 and 403 errors when accessing my blog, so be careful when applying these settings.
Step 1: Apache
Apache needs to be configured correctly. The following code needs to either be put in your virtual host file or in the main Apache config file (apache2.conf in Ubuntu and httpd.conf in others).
sh: /usr/bin/states: No such file or directory
Step 2: Unix Permissions
Eventually you’re going to have to change some options in the WordPress admin panel, but some permissions need to be setup first. When you change your permalink structure, WordPress is going to write to .htaccess in your WordPress installation directory. This means that this file needs to be world writable before WordPress tries to write it. Run the following commands in a shell to make sure .htaccess has the right permissions:
sh: /usr/bin/states: No such file or directory
Don’t forget to sudo if you’re in Ubuntu.
Step 3: WordPress Options
The last step is to change some options in the WordPress admin panel. Navigate to the “Options” -> “Permalinks” tab and select the option that looks like “http://www.yourdomain.com/2007/12/11/sample-post/”;
After fiddling with WordPress, you should be good to go! Shoot me some comments if you run into any problems.