Apr
22

Random Redirect Plugin

Filed under: Asides | April 22nd, 2007
Post

I wrote a quickie plugin based on an idea from Techcrunch, when you visit the URL it redirects you to a random post from your blog. (6)

6 Responses

Avinash | April 22nd, 2007 @ 10:56 pm

Sounds cool! I saw it working live @ TechCrunch. I’m gonna give it a try on my blog.

- Avi

Jeff | April 23rd, 2007 @ 9:31 am

It looks like (according to Live HTTP headers) that you are using a 301 moved permanently. You might want to consider 303 See Other instead.

From RFC 2616 re 301:
“The requested resource has been assigned a new permanent URI and any future references to this resource SHOULD use one of the returned URIs. Clients with link editing capabilities ought to automatically re-link references to the Request-URI to one or more of the new references returned by the server, where possible.”

That doesn’t seem like the right thing for a random redirect.

re 303:
“The response to the request can be found under a different URI and SHOULD be retrieved using a GET method on that resource. This method exists primarily to allow the output of a POST-activated script to redirect the user agent to a selected resource. The new URI is not a substitute reference for the originally requested resource.”

You might want to consider 302 Found as well. But I vote 303.

Matt | April 26th, 2007 @ 11:34 pm

It uses 302 for me.

Share your thoughts