URL's with "Underscores" instead of "Hyphens"

Author Message

John Smith

Friday 17 October 2008 4:38:54 am

Hi There,

Hope some one can help. Actually I installed ezpubish4.0.1 around some time ago. By default all the URLs are with separator "hyphen". But now I want to convert all the URLs with separator "underscore".

Is there any easy way to do it.

Another thing is it possible to install the future ezpublish with urls/underscores by default.

Cheers

Jean-Luc Nguyen

Friday 17 October 2008 6:59:08 am

You will find more info on custom urls on /settings/transform.ini:

Redefinining a new TransformationGroup on site.ini (only an example):

[URLTranslator]
WordSeparator=dash
TransformationGroup=urlalias_lowercase

And then creating a new transform.ini.append.php, which will take over the default one:

[Transformation]
Groups[]=urlalias_lowercase

[urlalias_lowercase]
# Extra transformation files for urlalias
Files[]
# Extensions that have transformation files when urlalias is used
Extensions[]
# The commands to use for search
Commands[]
Commands[]=normalize
Commands[]=transform
Commands[]=decompose
Commands[]=transliterate
Commands[]=diacritical
Commands[]=url_cleanup
Commands[]=lowercase

This is only an example, you can combine commands, and you will find more info on default file transform.ini

http://www.acidre.com

John Smith

Friday 17 October 2008 7:03:11 am

Thanks for your kind help.

Do I need to run any script after doing the changes in the INI files or the system will pick automatically.

Carlos Revillo

Friday 17 October 2008 10:12:22 am

after changes suggested by Jean-Luc, all your new contest will get a nice url with underscores.
for changing the old ones, you will need to run

php bin/php/updateniceurls.php -s yoursiteacces

from your Document Root

clear caches after that. sometimes i have truncated ezurlalias_ml table before running... i think the updateniceurls.php doesn't delete old entries, so i prefer delete them by myself...

hope it helps.

Maarten Holland

Sunday 19 October 2008 2:50:42 am

"Another thing is it possible to install the future ezpublish with urls/underscores by default."

I do this by uncommenting the line:

TransformationGroup=urlalias_compat

in 'site.ini'. It still creates a few URL's with capitals and hyphens instead of underscores (like /Users/Guest-Accounts) but by just 'editing' and 'publishing' those, the URL's get converted.

All new URL's are in /no_caps/using_underscore_for_separator format.

Hope this helps.

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 30 2025 21:42:33
Script start
Timing: Jan 30 2025 21:42:33
Module start 'layout'
Timing: Jan 30 2025 21:42:33
Module start 'content'
Timing: Jan 30 2025 21:42:33
Module end 'content'
Timing: Jan 30 2025 21:42:33
Script end

Main resources:

Total runtime0.0235 sec
Peak memory usage4,096.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0057 588.2578151.2266
Module start 'layout' 0.00570.0036 739.4844220.7188
Module start 'content' 0.00930.0124 960.20311,001.9297
Module end 'content' 0.02180.0017 1,962.132833.9922
Script end 0.0234  1,996.1250 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002912.1766140.0002
Check MTime0.00135.4592140.0001
Mysql Total
Database connection0.00093.719910.0009
Mysqli_queries0.00208.635230.0007
Looping result0.00000.046710.0000
Template Total0.00125.010.0012
Template load0.00093.774710.0009
Template processing0.00031.199410.0003
Override
Cache load0.00062.531710.0006
General
dbfile0.00031.422680.0000
String conversion0.00000.037540.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs