Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2005-10-24 16:01:27

jdueck
Plugin Author
From: Minneapolis, MN
Registered: 2004-02-27
Posts: 147
Website

Deciding on a clean URL scheme

I’m emailing this to a friend, thought I’d open it up here for peer review.

The topic is, How do you decide on a URL scheme for a new site?

——

Regarding url-schemes: I have thought about this issue, and here is what I think. I believe that functionally they are identical and so it is almost purely a matter of aesthetics (most end-users do not really care what your url looks like). I say almost because there is one small point that may materially affect your decision of which scheme to use, and it has to do with the extremely long-term future.

If you think there is any possibility you might switch away from textpattern at some point in the future, then you want to pick a clean url scheme now that is likely to be supported by other CMSs later on. That way, you reduce the chance of all your permlinks breaking when you switch to HappyPress 1.0 in 2008. If you use section/id/title and HappyPress doesn’t support it, you have to break all your permlinks, which mainly only affects your reachability from various search engines or others that have linked to you. Depending on your personality this could be a huge frustration or it could only be a minor annoyance.

If this is important to you, here’s what I’d do: I’d look through the available schemes and see if any are currently supported by other CMSs (WP, MT, etc). If they are, that increases their likelihood of being supported by future software as well, and gives you more freedom in future decisions.

If you are really concerned, I’d stay away from anything that uses the id in the URL. Although nearly all CMS probably have IDs in their database that can be used this way (just a guess there), the fact is that automatic database imports done by other CMSs are at least 50% likely to reset the ID during the import process. (I can’t say that for sure, that is just going off of my very basic familiarity with how databases work – I believe that when a field is given the “ID” type, that field’s value is managed by the database to ensure it is given a unique value.)

Offline

#2 2005-10-25 17:17:45

LeeStewart
Archived Plugin Author
From: Boston, MA, US
Registered: 2005-07-25
Posts: 81
Website

Re: Deciding on a clean URL scheme

Picking the URL scheme based on moving to another system is too much research for me. And who knows what the other CMS programs will support in the future.

Since you’re using clean URLs, you can map from the old style to a new one using .htaccess (worst case) or (best case) using a plugin with the new CMS.

[Lee]


Monkeys could have written a better post..

Offline

#3 2005-10-25 20:00:55

Sencer
Archived Developer
From: cgn, de
Registered: 2004-03-23
Posts: 1,803
Website

Re: Deciding on a clean URL scheme

It’s funny, I caught myself nodding to everything you said, until you got to the last paragraph:

If you are really concerned, I’d stay away from anything that uses the id in the URL. Although nearly all CMS probably have IDs in their database that can be used this way (just a guess there), the fact is that automatic database imports done by other CMSs are at least 50% likely to reset the ID during the import process. (I can’t say that for sure, that is just going off of my very basic familiarity with how databases work – I believe that when a field is given the “ID” type, that field’s value is managed by the database to ensure it is given a unique value.)

Because my advice (and in fact what I do for the sites I manage myself) was always the exact opposite. I have moved twice: From custom to b2, and from b2 to Textpattern. And everytime I was able to rewrite my old urls to the new urls precisely because there was a unique ID in the url.
You can always modify any import script for “Happypress” to preserve the article-ids (that is, if you know a bit of programming to get along). The ID is really the only thing that is unique and easy to match with patterns, when you want to redirect old urls to new urls. The alternatives are always combining more items and thus maaking it more complex (for example, using year+month+date+article-title to uniquely identify an article; or worse arbritrary keywords/section-names/category-names in any combination).

Example: b2 to Txp I used
<code> RewriteCond %{REQUEST_URI} ^/i\_p\-[0-9]+
RewriteRule i\_p\-([0-9]+)\, /$1/ [R=permanent,L]</code>

to rewrite all articles. (and a couple more rules for feeds etc.). Now switching from IDs to dates, or from dates, to named hierarchies, is not possible with such rules, you basically have to have a mapping of all individual url-pairs (old and new).

The implicit assumption I am making is that most software will not offer any identical url-schemes, then I think the conclusion that the ID in the URL is a good thing, is correct.

Of course if you start from the assumption that any possible future CMS that you might switch to will offer (at least) one url-scheme that is identical to one of the currently available ones, you may come to different conclusions (go with the one that is most likely to be identical in other software), but that’s not a given I would say.

Offline

#4 2005-10-25 20:16:55

jdueck
Plugin Author
From: Minneapolis, MN
Registered: 2004-02-27
Posts: 147
Website

Re: Deciding on a clean URL scheme

Picking the URL scheme based on moving to another system is too much research for me. And who knows what the other CMS programs will support in the future.

You have to put yourself in the shoes of someone giving advice to someone else.

Yes, I agree it’s more than you or me would bother thinking about. But different people have different priorities. (Before, when all we had was section/id/title, we had some people obsessing about it because they couldn’t stand the way that id number looked in their urls. As though readers ever notice or really care what your urls look like.)

So if someone asks me, how do I decide which one to use, I would say: pick one that looks nice to you. Are there any real factors to consider? Yeah, well, there’s this one: future portability. And it’s kind of a long shot. But that’s the only one I can think of.

Last edited by jdueck (2005-10-25 20:18:08)

Offline

#5 2005-10-25 20:24:24

jdueck
Plugin Author
From: Minneapolis, MN
Registered: 2004-02-27
Posts: 147
Website

Re: Deciding on a clean URL scheme

Sencer, that is one of the main pieces of input I was looking for. I was especially hoping for someone to clear me up on this:

You can always modify any import script for “Happypress” to preserve the article-ids (that is, if you know a bit of programming to get along).

Thanks.

Last edited by jdueck (2005-10-25 20:27:34)

Offline

Board footer

Powered by FluxBB