Skip to: Navigation | Content | Sidebar | Footer

Weblog Entry

Movable Type Fun Day

July 25, 2003

It’s Movable Type Fun Day!

First start with Paul’s account of switching from .html file extensions to .php, and how gracefully MT handled the transition. Even existing off-site bookmarks don’t break!

Then head over to Scott’s place to read up on how he managed to wrangle Movable Type into producing human-friendly, meaningful URLs instead of the arbitrary sequential URLs that MT ships with. Fun!

Then take a look at the URL attached to this post (click the title), and rejoice for I too have switched to more meaningful URLs. Except… oh wait. Look at that. No I haven’t.

The intent is there, but instead of something nice and tidy like my server spits out a bunch of extra crud and delivers the far worse (pause for breath) archives/2003/07/25/movable_type_fun_day/default.asp. Sigh. I know how to fix this: migrate to PHP. Guess what the chances are of that happening soon? It’s back to the drawing board for me. Apologies to those who are reading my RSS feed, it’ll get worse before it gets better.

The bright side though is that I finally put together a swanky ‘recent comments’ page so that I (and you) can keep track of who’s saying what where on this site. It’ll step out of beta as soon as I can figure out how to link it in on the right sidebar.

update: comments also available as a validating RSS feed!

further update: Damn it all anyway. Instead of break anyone’s new bookmarks over the weekend, I went ahead and reverted to the old filename system, so the above is no longer relevant. I’ll leave it up as an explanation of my file system, mainly for my own reference.

Reader Comments

Sean says:
July 25, 04h

If your host allows custom 404 pages and the Server.Transfer method, you can hack around that reasonably easily. It’s slow, and it shows up as a load of 404s in your access logs, but it’s the only workable solution for a lot of IIS hosting plans.

Dave S. says:
July 25, 04h

No such luck, Sean. My host is pretty particular about server-side access. I don’t have custom 404s much to my chagrin.

I want to make the switch to Apache & PHP so I can start playing with those wonderful things. But it involves a lot of conversion at this point… Too much of a make-work project right now.

ss says:
July 25, 04h

Dave, actually you can more your archives directory from your current /cgi-bin/mt/mezzo/archives to just /archives/ without having PHP installed.

Furthermore, you can use PHP without actually changing your file extensions from .html to .php. I use PHP includes with .html extensions and it works just fine.

Dave S. says:
July 25, 04h

Scott — I tried that when I initially set up this site. My host doesn’t allow CGI scripts running in /cgi-bin/ to write data outside of the directory, so /archives/ just isn’t possible given my current setup.

One day I’ll move over to PHP, and all my problems will be solved.

…after re-writing my image gallery script, re-doing my directory structure, re-linking my includes, and making sure all my MT templates still function, that is.

ss says:
July 25, 04h

Ah, gotcha. One more comment from Paul’s site regarding the use of PHP with .html files, you’ll have to add this line to httpd.conf or a local .htaccess file to get it to work:
AddType application/x-httpd-php .htm .html

Sunny says:
July 25, 06h

Movable Type is an awesome tool…

I “dirify”-ed my archives just right now. Ok their were only 5 posts, but it is really cool.

can anybody point me to a good article on how to rewrite files with .htaccess?

Jay Allen says:
July 25, 08h

A Users Guide to URL Rewriting with the Apache Webserver

Module mod_rewrite URL Rewriting Engine

A List Apart: URLs! URLs! URLs!

Search Engine Friendly URLs with mod_rewrite

Dave S. says:
July 26, 01h

res — yeah and no. Theoretically, I could start linking up each post as /cgi-bin/mt/mezzo/archives/<$MTEntryTitle$>.asp, which provides a bit more meaning than /same path/000197.asp; I went for the all-or-nothing approach though, and lost, when I got stuck with the big long path plus the extra path for the date (/2003/07/24/) plus the filename.

Ideally I’d like to see:

But I think the best I could possibly do, considering the wrangling I’d have to do inside MT and the aesthetics, is:

I just don’t see that as being worth the effort, compared to:

SFT says:
July 26, 05h

Purely aesthetically, I find six-digit indentifiers more pleasing than titles with an arbitrary number of words and underscores. Underscores in URLs really bug me.

And honestly, how much usefulness does it add to blog entries to have that kind of info in the URL? It’s not like anyone’s going to be typing in the URL, because they’d have to type through /YYYY/MM/DD/ anyway. When people link to it, the text they link with is much MUCH more likely to be helpful (and paid attention to) than the entry’s title. When people bookmark it, the entry title will appear in the browser’s bookmark menu.

Perhaps it’s not Zen, but practically speaking, numerical URLs win out in my opinion.

However, I don’t use the arbitrary sequential IDs, either; I use a timestamp. My URLs are all /archives/YYYY/MM/DD/HHMMSS/. That keeps the URLs consistent if for any reason you have to export / reimport all your entries from / to MT. Otherwise the numbers will get totally screwed up.

Dave S. says:
July 26, 06h

Google weights keywords in the URL heavier, so I’d imagine that’s one major benefit to using titles as filenames…

resonance says:
July 26, 12h

Dave, you tried the following in the weblog config->archiving->archive file templates? I know this is covered in the comments for the article to which you link above, but just in case:

For example, I used the following to generate the urls for my gallery pages (which are determined by an entry’s category):


Just about all the pages in my photo section are generated with php, as they were with my last version. If you want your individual archives to have the entry’s title with a php extension, try the following archive file template for your individual archives:


(I can’t remember whether it’s EntryTitle or ArchiveTitle, but one of them will work…in developing the new version of my site, I had titles in the urls, but found that I’m prone to long titles, and I’m not so enamored with very long URLs.)

Be sure to check the weblog config to make sure the url path to your archives is correct.

I’m probably totally misunderstanding your dilemma…?

resonance says:
July 26, 12h

damn. forgot to encode my tags.

The first one is: gallery_ <$MTArchiveCategory dirify=”1”$>.php

the second: <$MTEntryTitle$>.php


Sunny says:
July 26, 12h


Thanks a bunch for the reesources. I really appreciate your help.

Stan says:
July 27, 07h

Dave, just for future reference, Elizabeth Lane Lawley just went through this pain. Seems that with the help of Mark Pilgrim they have a solution but I believe it requires the Apache server with mod_rewrite as well. See: . I’m going to try this when I get time.