some WordPress pointers …

Ok folks, after wrestling with permalinks and mod_rewrite, I’ve deciphered a number of well-scribbled Post-Its to give you some pointers on how to ‘tune’ your WP blog.

Firstly, your Apache build needs to include mod_rewrite – if it doesn’t, fix this then come back here. mod_rewite is required to enable permalinks and improve the aesthetics of your URI so instead of a messy URI that includes references to hard-coded page entries in MySQL database e.g. …/blog/index.php?p=xxx, you get a nice URI referenced by the title of your post e.g. …/blog/my-post/. Permalinks also create a more constant reference for search engines/RSS feeds, especially if you intend to reindex or change the underlying database of your blog later.

Problem 1: Permalinks do not appear to work.

1. Check your Apache httpd.conf (in /etc/httpd/) and make sure that within the ‘Directory’ tag, Allow Override is set to ‘All’
2. Check for existence of a .htaccess file in your blog directory, if not create one by touch .htaccess
3. Make sure .htaccess has correct permissions, chmod 666 .htaccess should do the trick
4. Go back to WP admin, and under Options/Permalinks, select a template tag for your structure – if you’ve done all the above, WP should edit the .htaccess automatically.

Problem 2: Trailing slash is missing in the header URI.

This is a really irritating problem. In WP 1.5 (upwards), the trailing slash has been removed (ostensibly for consistency!) such that when you click on the header hyperlink to take you back to your blog’s index.php page, you get a 404 error instead. There are a couple of ways to fix this:

1. add the trailing slash yourself in themes/header.php wp-register.php and wp-login.php (not very elegant since this requires constant changes if you use multiple themes)
2. add a ReWriteRule in your .htaccess file as follows:

ReWriteEnginge On
ReWriteBase /your-blog-directory-name/
ReWriteCond %{REQUEST_FILENAME} -f [OR]
ReWriteRule you-blog-directory-name /your-blog-directory-name/index.php [L] *** add this line

What this does is everytime Apache gets a URI request pointing to the directory of your blog with a missing trailing slash (if there’s no /, Apache thinks you’ve requested a file rather than a directory), the rewrite rule appends /index.php to the URI, thus avoiding the 404 error. The [L] then tells the rewrite to stop after executing this rule.

Tomorrow, I shall tackle themes to improve the ‘look’ of my WP blog but for the moment, this blog has been imported into WP from blogger.com

mini in name only …

Success … I think. My Mac Mini is now purring handsomely beside the plasma and is configured as an auxiliary Apache web server, but armed to the teeth naturally with the usual power tools – Postfix mail, php, MySQL and Webalizer (to name but a few). I’ve also added WordPress to the arsenal and got as far as hosting a test blog before turning to post this writeup – in a word, this Tiger is bitchin’ .

But here’s the million dollar question: is OS X simpler to use than Windoze? Well, ummm … maybe. Tiger’s brill when you’re doing noddy everyday stuff – and some of the cool things like widgets, Sherlock and RSS integration into Safari really put Bill’s HCI team at MS to shame – but the advanced stuff is not for the faint hearted and for this reason, it is well hidden from the user. So much so I’ve had to delve deep into the subconscious to dredge up what few nuggets are left from previous UNIX encounters to work around some challenging installation problems. Fortunately, I located this guide before resorting to hari kiri.

The bottom line … I’m a *very* happy bunny and with OSXvnc installed, I’ll be taking this little pussy to bed tonight, albeit remotely on my Windoze laptop. The Mrs, on the other hand, is not so thrilled about the idea … ;o)

toys & boys …

Two cool things will happen next week: my Mac Mini is scheduled to be delivered on Wednesday and we’ve got tickets for the opening of Star Wars III: Revenge of the Sith on Thursday. Not surprisingly, the boys are hyper with anticipation for the latter, and the Force is unmistakably strong in their rooms: Lego bricks that once lay lifeless in ambush of parental feet (why is it they hurt so much when you stand on them?!) have been restored into impressive battle crafts as the boys re-enact the scenes from Hoth, Besbin and Geonosis with the usual cacophony of whizz, bangs and pops comensurate with the intensity of the conflict. As for me, I intend to chill in front of the telly with the Mac (I’m plugging the Mini into the DVI of the 42″ plasma to achieve the holy nirvana of 1920 x 1200) and do lots of hand-waving (using the wireless air-mouse from Gyration while unravelling the delights of the new Tiger OS. Ummmm, just can’t wait …