Some thoughts on url formats.
Here are some thoughts on pretty urls. A few months ago, Zena was using an url design based on node’s paths, using the name attributes of a nodes. For example, this was an url from this site :
http://zenadmin.org/en/documentation/zazen
This url is quite pretty but has some obvious drawbacks. What if after writing some more pages, we realize that the ‘zazen’ page (which explains the markup used to write articles) should not live in ‘documentation’ but rather in some ‘user manual’ ? We move the object and it’s url becomes :
http://zenadmin.org/en/manual/zazen
The old link now points to some 404 page not found error page. So, how do we solve this problem ? We could remove all the details of our objects out of the url and map urls to something like :
http://zenadmin.org/en/page6.html
This is better, as most people don’t really read urls, they just look at how ugly they can be (how may & and = there are). The drawback is that you cannot divide your site into sections, naming those sections into your url.
Maybe the best solution would be some kind of mix between the ‘no name’ url and the ‘full path’ one. Each node could redefine it’s own ‘base’ (as is done with templates), every descendant of the node would then inherit this base. For example, a site could have one base for ‘manual’ and one for ‘documentation’, thus the link for ‘zazen’ could be :
http://zenadmin.org/en/documentation/article6.html
and, later
http://zenadmin.org/en/manual/article6.html
The url changed, but we keep a reference to the object id, we can thus send a ‘redirect’ instead of an error page and the user is not disappointed. This also makes it easier to manage notes urls :
http://zenadmin.org/en/documentation/note19.html
This is better then the actual :
http://zenadmin.org/en/2007-1-30-prettyUrls
Pretty urls are bad if they only serve the programmer’s maniac focalization on something most users don’t even look at and which could make the long term viability of a site quite hazardous. Splitting a big site into smaller entities, each having it’s own ‘name space’ can be useful as long as it doesn’t make your site brittle.
These ideas have now been implemented into Zena.
Gaspard Bucher