Articles tagged “permalink”

A permalink_fu improvement: allow modification of permalinks and send HTTP redirects on-the-fly

Another spin-off from the website: a permalink_fu improvement that allows dynamic permalinks. I know it is an oximoron, because permalinks should be .. well .. permanent! And because search engines index them, they should never change. But what happens when you publish something, your permalink is generated with permalink_fu using the title of your post, and after a couple of days you want to change the title, and the permalink under which the post is accessible as well?

Following the specification, your app should send out a 301 moved permanently HTTP status when accessing the old permalink and redirect the client to the new Uniform Resource Locator. That’s quite the same thing what my modification to permalink_fu does: whenever your post attributes are changed, the former and new permalinks are saved to the database, and you can enable your controller to generate 302 moved temporarily redirects when needed. In other words, it checks whether the requested URL is an old permalink, and automagically redirects the client to the new one.

continue reading >>>

Posted at 19PM on 01/29/09 | 2 comments | Filed Under: development


This is, a weblog by Marcello Barnaba (@vjt) about technology, ruby, development, software, the internet, entertainment, politics, sociology, and the answer to Life, Universe, and Everything (42).