A permalink_fu improvement: allow modification of permalinks and send HTTP redirects on-the-fly
Another spin-off from the www.visitacsa.it 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.
The 302 code was chosen because the 301 permanent status code has quite disruptive effects on search engines, but more discussion is welcome.
About this entry
You’re currently reading “A permalink_fu improvement: allow modification of permalinks and send HTTP redirects on-the-fly”, an entry on sindro.me
- 01.29.09 / 19PM
- 02.20.09 / 04AM