Ruby, Rails, Firefox, Anime, Mac
In: Blogging26 Jul 2003
Thanks to this entry at Contact Sheet, this blog now features friendly, meaningul URLs. Previously, individual entry archives (permalinks) were named like so: 00034.html. With simple changes to the archiving configuration, individual archives are now named like so: http://blog.codefront.net/archives/2003/07/26/button_maker.html, monthly archives like so: http://blog.codefront.net/archives/2003/07/index.html, and category archives like so: http://blog.codefront.net/archives/Blogging/index.html.
There isn’t a trick to it. In fact it’s in the MovableType documentation itself. If you have a MT blog yourself, go to ‘Weblog Config’, then ‘Archiving’, and click on the question mark next to ‘Archive File Template’. It’s all there, even with examples.
How to do it:
– go to ‘Weblog Config’
– go to ‘Archiving’
– for ‘Individual’, under ‘Archive File Template’, enter: <$MTArchiveDate format="%Y/%m/%d/"$><$MTEntryTitle dirify="1"$>.html
– for ‘Daily’, enter: <$MTArchiveDate format="%Y/%m/%d/index.html"$>
– for ‘Monthly’, enter: <$MTArchiveDate format="%Y/%m/index.html"$>
– for ‘Category’, enter: <$MTArchiveCategory$>/index.html
Of course, you are free to tweak the names of the archive files. Some of you may want to keep your archives by category instead of by date, so something like <$MTEntryCategory dirify="1"$>/<$MTEntryTitle dirify="1"$>.html would give ‘category_name/entry_title.html’ for individual entries.
Rest assured that your old permalinks that have been spidered by Googlebots and linked to by other sites will be safe – MT does not delete the old files, but leaves them intact. It is prudent though to make this change as soon as possible , if you ever intend to do so.