Enabling Pretty Permalinks on Wordpress on Webfaction

By andy July 9th, 2008

Rather than have the unfriendly http://yourblog.com/?p=16 style URLs to blog entries, it is possible to have something more user friendly such as http://yourblog.com/2008/07/name-of-post/. This is important, because it is by these names that the blogs are found in search engines and blog to blog references.

WordPress describes how this can be done here.

However, on Webfaction, the .htaccess file is not writable by default. So Wordpress cleverly gives you the config snippet you need to put in there manually. You get the message:

If your .htaccess file were writable, we could do this automatically, but it isn’t so these are the mod_rewrite rules you should have in your .htaccess file.

However, you can set the permissions so that Wordpress can manage this directly itself.

  1. SSH into your Webfaction account.
  2. cd into your wordpress directory such as /home/your-account/webapps/wordpress
  3. Check there is not already an .htaccess file with ls -al
  4. Create an empty .htaccess file with touch .htaccess
  5. Set the permissions so that Wordpress can edit it with chmod 666 .htaccess
  6. Check with ls -al that the permissions have gone from -rw-rw-r-- to -rw-rw-rw- (It is now writable by any user on the Webfaction machine - including the Wordpress application hosted by Apache)
  7. Go back to http://yourblog.com/wp-admin/options-permalink.php and press [Save Changes] again.
  8. Check with ls -al that .htaccess is no longer a zero byte file - Wordpress updated it itself.
  9. Set the permissions back to a safe value with chmod 644 .htaccess

This entry was posted on Wednesday, July 9th, 2008 at 11:05 pm and is filed under Uncategorized. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Leave a Reply