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: http://download.alanedwardes.com/pretty-random-redirect/random-redirect.php
Grab the normal PHP file in a zip: http://download.alanedwardes.com/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.



















