Alan Edwardes

Ma.tt's Random Post Plugin With Pretty URLs

Warning: This method doesn't work with WordPress 2.5. I've written a more recent post that makes it work with WordPress 2.5 using a page template.

Matt Mullenweg created a plugin called Random Rediret last year, which enables you to visit http://www.example.com/?random, and for you to be redirected to a random post from that website. I love the plugin, as you can see the "random post" link above.

But.. I like all of the links on my blog to work with "pretty URLs", hell I even have my search feature working with that. Call it obsessive, but I just feel that the ?random link breaks the swing of things somewhat, so i've modified the plugin to work with a http://www.example.com/random/ link instead.

It's worth nothing that although it does make the random URL a pretty one, it will break any pages that you have called random.

Grab the source: /static_media/dl/pretty-random-redirect/random-redirect.php

Grab the normal PHP file in a zip: /static_media/dl/pretty-random-redirect/random-redirect.zip

It's such a minor update to such a small plugin I thought there would be no point in branding it under my own name and attributing Matt, so I've left the meta aspects of the plugin in tact. It just looks like the normal Random Redirect plugin, and I won't be uploading it to the WordPress plugin database.

25th of March 2008 at 9:10 PM

4 years, 1 month ago

written by Alan Edwardes.

221 words

rand: Windows Movie Maker HD

next: UK Internet Speeds Suck

prev: Firefox Start? Not quite.

share:FacebookTwitterRedditdiggStumbleUpondeliciousHacker NewsLinkedIn

Add a Comment

© 2006 – 2012 Alan Edwardes / code on github
Top