Forums / Developer / patch to make the "alias url" look better (readability / search engines)

patch to make the "alias url" look better (readability / search engines)

Author Message

Ronnie Garcia

Wednesday 18 August 2004 3:13:26 pm

Hello,
I noticed that when eZ publish builds an "alias url", it stripped all special characters including accents to replace them with a "_".
I'm french and accents are really <b>common usage</b> here.

Nowadays, search engines (especially Google) give a considerable importance to the url of crawled pages and thats why i wanted to change this default behaviour.

I made a patch against eZURLAlias:: so that it does remove accents and convert ligatures to their 2-letters equivalent.

An url like :

index.php/site/pr_sentation_des_l_ments_de_mon_uvre

Where the title was "Présentation des éléments de mon ¼uvre" (some characters may have been dropped by your browser) would now be translated to :

index.php/site/presentation_de_mon_oeuvre

Witch can make a significant difference regarding to readability and search engines.

I can send the patch to anyone interrested. What is the official way to send a patch to the core team ?

Regards,
Ronnie Garcia.

kracker (the)

Wednesday 18 August 2004 3:35:15 pm

Why not simply package it and post it as a contribution as a solid first step?
http://ez.no/community/contributions

This way others can benefit from the patch right away without having to wait for it to be accepted and integrated into eZ publish.

You might also want to include some basic installation instructions and what licence your distributing the patch under (If your not sure about which licence I suggest the GNU GPL as it seems this would fall under the category of derived work of an existing GPL package).

Happy Hacking,
\\kracker
http://ezpub.co.uk/

Sole : Bottle Of Humans : Our Dirty Secret (Feat. Alias, Dose, & The Pedestrian)

Member since: 2001.07.13 || http://ezpedia.se7enx.com/

Bård Farstad

Wednesday 18 August 2004 10:17:39 pm

There is actually functionality for this almost ready in the 3.5 development version. 3.5 will have support for this, the translation is configurable for the different locales.

--bård

Documentation: http://ez.no/doc

Ronnie Garcia

Thursday 19 August 2004 4:53:31 am

Glad to know.

And by the way, i saw that someone (Gunnstein Lye) had already posted a similar hack there :
http://ez.no/community/contributions/hacks/url_alias_transliteration

I will use mine (looks faster) until 3.5 is released.

Regards,
Ronnie Garcia.

Ronnie Garcia

Thursday 19 August 2004 5:59:35 am

Because this discussion is important, i would add some informations about search engines.
Several forum [1] seem to confirm that search engines (at least Google's based ones) dont treat "_" as a word separator.

Then i think it would be worth, while you're at it for 3.5, to change the default behaviour and replace any non-valid character into an hyphen (-) instead of an underscore (_).

[1] :
http://forums.digitalpoint.com/showthread.php?t=210
http://www.markcarey.com/googleguy-says/archives/discuss-googleguy-confirms-that-underscores-are-not-word-separators.html

Regards,
Ronnie Garcia.