Joe recently changed his URLs to look like: http://bitworking.org/news/Bulu_0_93_Now_Deployed
from urls that were based simply on numeric ids like http://bitworking.org/news/81 (doesn't work anymore).
Currently, my URLs look like: http://www.keithdevens.com/weblog/3777
I'd like to do something like he did. Except I really don't like what he did, because then all titles ever have to be unique (which is bad). There are a few options:
LGF has URLs like: http://www.littlegreenfootballs.com/webl...91_Peaceful_Religion_Seething_in_Iraq
where he has the id and obviously ignores everything starting with the first underscore.
Den Beste has ones that look like: http://denbeste.nu/cd_log_entries/2003/04/SomenewsfortheBBC.shtml
where the URL is relative to the month and has words smushed together.
I could smush words together, but I'd probably just replace spaces with underscores (and correct other non-url characters). The other option would be something like http://www.keithdevens.com/weblog/3777#The_heroism_in_Harry_Potter, but I really don't like using "fake" anchors. Plus, it would make it impossible to have something like http://www.keithdevens.com/weblog/3777#The_heroism_in_Harry_Potter#comment7777
I'd like to get dates in there too, but for me that gives you urls that are just way too long: http://www.keithdevens.com/weblog/archive/2002/Jun/11/GET_after_POST_revisited
And I really don't want to make the posts dependent on the title, which can change.
Simon's URLs are instructive: http://simon.incutio.com/archive/2003/04/17/pythonRoundup
Where they're relative to the date, and are based on a unique name (within the day, at least) which mustn't change (as opposed to a title). I really like this. The URLs aren't overly long if you don't choose a long name, yet they can still be descriptive. The downside is that you have to go through the effort of choosing a good name every time. Plus, there's no hook in w.bloggar for the post name. I could fake something, but that's icky.
So, I have a few choices:
- I can keep my short URLs and add on an ignored title like Charles does with LGF. So that would look like: http://www.keithdevens.com/weblog/3778/More_URL_questions. You can still put comment anchors on it, so it wins there. Plus, it's easier to read than something with smushed words like '/3778/Moreurlquestions', or even '/3778/MoreUrlQuestions'. And if I change the post title, which happens sometimes, links don't break. And there're no problems with posts that don't have titles. So this is definitely what I'm leaning towards. But maybe it's better with something like '/3778|More_URL_questions' or ''/3778-More_URL_questions'' so it doesn't give the appearance of being a 'directory'?
- I could go the super-long route and have URLs like http://www.keithdevens.com/weblog/archive/2003/Apr/18/3778/More_URL_questions. Again, the URL isn't dependent on the title, which is a requirement. But it's freaking huge. One of my goals is to have URLs that generally won't wrap in an e-mail program (and even if they do, to not affect where the URL resolves to if you click on it).
- I could do something like Simon does. This URL would then look like: http://www.keithdevens.com/weblog/archive/2003/Apr/18/URLQuestions. Not too bad, but still long. The URL is dependent on the name, but it won't wrap in an e-mail program that wraps at 76 chars if my short name is less than 22 characters
. However, to be safe I could make the uniqueness of the URL dependent only on the first N characters so it wouldn't matter if some got cut off.
Keep in mind that these don't necessary have to be exclusive. For instance, my weblog software still allows URLs that look like: http://www.keithdevens.com/weblog/archive/2003/Apr/18/#id3777
I just don't use those for linking, because if you do that you have to provide a separate "Comments" link, and you wind up with other problems, as Simon discovered.
Anyway, any comments?
I'd go with the third alternative, but ditch the "archive" part (and possibly the "weblog" part, too). It's redundant information. A URL like http://www.keithdevens.com/2003/Apr/18/URLQuestions is nice, short and relevant. And it leaves 37 chars for the identifier. 41 if you leave the "www" out as well.
Allowing multiple URLs to point to the same resource can be quite nice, but you should always consider redirecting alternative URLs to the "primary" one. FOr one single resource, the URL i see in my browser should always be the same no matter how I got there.