Slash My Permalinks
08 Oct 2004One of the puzzles I needed to solve when switching back to Movable Type was how to keep my permalinks. Actually, most of the permalink was easy, thanks to Mark Pilgrim's cruft-free URLs. The problem was the slash at the end.
I've forgotten where, but somewhere I read that cool links end with a slash, since the URI is then a directory and it doesn't matter what filetype (if there is indeed a file at all) contains the page, the URI won't change. However, MT doesn't differentiate between the permalink and the filename that it saves. If you try to set MTEntryPermalink to a directory, MT tries to write to the directory instead of a file, which of course fails.
One approach is to set MTEntryPermalink to blah-blah/index.html, and write a one-line global filter plugin to delete the filename from every instance of MTEntryPermalink in all templates. I tried it, but it's a pain to add an attribute to all those instances, and the trackback data was still wrong.
A better approach is Dave Dribin's patch to MT.pm so you can set MTEntryPermalink to a directory, and have MT save the template to a file index.html (or index.whatever). That's what I'm doing now, but of course the problem with a patch is that it's a patch, and you have to remember to re-apply it when MT 4.0 or 3.2 or 3.112384 is released. But maybe the same thing can be accomplished with the new plugin architecture in MT3. Stay tuned.