Old Archive Entries

Not long ago, I updated the format for the names of links. This wasn’t terribly complex, but it does raise the question of how to deal with all those “old” pages. For instance, I see an increasing number of people hitting my page on The Angler Fish (now on the first page of results at Google!). Unfortunately, they are using the old URL to access it.

Naturally, I didn’t want to lose those hits, so I had to come up with something. I’ve never been a big fan of simply redirecting traffic to the new location – and I have 40-plus entries that may be saved using the old URL naming scheme. Since I didn’t want to set up each one individually through redirection on the web site, I needed to come up with something. Even to create redirection, something needed to happen or there would be lots of work involved on my part!

Movable Type to the rescue. One of the lesser-known functions (at least based on my searching) is the ability to use template tags in archive naming. In fact, one of the most useful things is the ability to use multiple naming conventions for the same archives. The change I mentioned earlier was done to create a new, more useful name. I simply created a new archive template.

To handle the “old” archives correctly, I added a new section to that archive template that made use of the new naming scheme, so that people could see where to go:

<$MTEntryCategory dirify=”1″$>/<$MTArchiveDate format=”%Y/%m/%d”$>/<MTIfEmpty var=”EntryKeywords”><$MTEntryTitle dirify=”1″$></MTIfEmpty><MTIfNotEmpty var=”EntryKeywords”><$MTEntryKeywords$></MTIfNotEmpty>.html

Now the original page is there, and it contains a banner to point you to the new page. Voilá!

This method could also be used to automatically create a meta refresh tag, or perhaps Javascript or ASP or something that would do the work for you – but I preferred this method. If you like those other options, only the code between the tags would change.


Posted

in