eZ Community » Forums » Setup & design » Nice URL Delimiter: Change _ to -
expandshrink

Nice URL Delimiter: Change _ to -

Nice URL Delimiter: Change _ to -

Thursday 11 September 2003 12:28:32 am - 7 replies

Is it possible to change the use of underscores to dashes in nice URLs?

Alex

Thursday 11 September 2003 1:14:07 pm

There is no config option for this. You must do a change in kernel/classes/ezcontentobjecttreenode.php. In the pathWithNames() function you will find two preg_replace expressions. Change underscore to - in the second array argument in both preg_replace calls. Then rerun update/common/scripts/updateniceurls.php.

Friday 12 September 2003 3:59:44 pm

Thanks Gunnstein!

I'm not sure if I want to make the change badly enough to tinker with code that may be overwrittein in future upgrades. I have to keep track of enough changes as it is. happy.gif Emoticon It would be nice if future versions of eZ publish provided this as a setting during setup or within the site.ini as the URLs delimiters can have a direct impact on search engine ranking.

Thanks again,

Alex

Tuesday 03 April 2007 7:43:10 pm

Has anyone been able to find where this moved to in the 3.7, 3.8 or 3.9 versions? It is no longer in the ezcontentobjecttreenode.php that I can see.

Tuesday 03 April 2007 8:22:54 pm

Hi Mark

It is converted by eZ's transliteration system ( http://ezpedia.org/wiki/en/ez/transliteration ), in eZURLAlias::convertToAlias. The different commands are listed in transform.ini. The one you're looking for is url_cleanup. At the end, you'll have to look at the top of eZCodeMapper::generateCommandCode and eZCodeMapper::executeCommandCode, where preg_replace is transforming your url.

Good luck!

<b>Edit:</b> apparently this question has been answered before: http://ez.no/community/forum/general/transformation_url_transliteration. I did make a nice trip however through the kernel and lib to find it out happy.gif Emoticon

Modified on Tuesday 03 April 2007 8:30:02 pm by Kristof Coomans

Tuesday 03 April 2007 10:53:54 pm

And it seems that is has been done already : http://www.premiere.fr/premiere/cinema

(Not by us happy.gif Emoticon

Tuesday 03 July 2007 12:46:59 am

"This feature will be part of up-coming eZ Publish 3.10 release. User can define whatever separator want in url alias." by Lukasz Serwatka

seen on http://issues.ez.no/IssueView.php?Id=11063&activeItem=1

Modified on Tuesday 03 July 2007 12:48:30 am by Damien Pitard

Sunday 23 December 2007 8:07:38 pm

Hi,

i use ezpublish 3.9.4 and i have appplied the patch for dashed url ... now how can I update all existing objects? Launching /bin/php/updateniceurls.php url are not updated .

Thx

Modified on Monday 24 December 2007 4:31:40 pm by Fabio G.

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from