[development] Re: [infrastructure] Drupal.org should have better URL aliases

Adrian Rossouw adrian at bryght.com
Tue Dec 27 10:52:35 UTC 2005


On 27 Dec 2005, at 11:30 AM, Dries Buytaert wrote:

>> To Adrian's point, node IDs aren't useful to your casual web  
>> visitor. Therefore Drupal distros should default to include and  
>> have enabled pathauto and perhaps follow the WordPress model (the  
>> only model with which I'm familiar; if another system is better,  
>> I'd be interested in its structure as well).
>
> I think WP doesn't use an intermediate table that contains (source  
> URL, destination URL)-tuples.  Instead, it directly translates the  
> URL to a database query that looks up the post.

Why not specify that every node / user has a custom path , in the  
user / node table.

During initialisation it just means we have to do 2 more small  
lookups to see if the url has been aliased.
Creating links we have to make sure to use the $node->path or $user- 
 >path property.

This would cut down on a number of queries for aliases as you almost  
always have the node object / user object
when you are busy linking to it

We'd still need the alias table for anything that aren't these  
primary objects though.

You can still provide additional aliases with the alias table, but  
these won't be used as
outgoing links over the node/object path.

Drupal:
>  + Any URL can be aliased, not just those related to posts.
>  + Any URL can have multiple aliases: 'team', 'about' and 'about- 
> us' can point to the same page or content.  (A bad idea as Google  
> will penalize you for this.)
>  - Performance penalty when URL aliases are enabled; up to 100+  
> queries/page.  These queries are very fast though.
>  + Very fast when URL aliases are disabled.
>
> WordPress:
>  - Only some URLs can be aliased.
>  - Limited to one alias per post.
>  + Small performance penalty.
>  - Not as fast as Drupal when URL aliases are disabled.




--
Adrian Rossouw
Drupal developer and Bryght Guy
http://drupal.org | http://bryght.com




More information about the development mailing list