Enabling Pretty Permalinks on Wordpress on Webfaction
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
.htaccessfile were writable, we could do this automatically, but it isn’t so these are the mod_rewrite rules you should have in your.htaccessfile.
However, you can set the permissions so that Wordpress can manage this directly itself.
- SSH into your Webfaction account.
- cd into your wordpress directory such as
/home/your-account/webapps/wordpress - Check there is not already an
.htaccessfile withls -al - Create an empty
.htaccessfile withtouch .htaccess - Set the permissions so that Wordpress can edit it with
chmod 666 .htaccess - Check with
ls -althat 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) - Go back to http://yourblog.com/wp-admin/options-permalink.php and press [Save Changes] again.
- Check with
ls -althat.htaccessis no longer a zero byte file - Wordpress updated it itself. - Set the permissions back to a safe value with
chmod 644 .htaccess