URL translation and language switcher redirecting to untranslated URLs

Author Message

Mathias G

Wednesday 17 August 2011 6:04:18 am

Hey,

I'm currently setting up a site on Community Project 2011.7 and need some help regarding translated URLs. The site is multilingual, has 4 siteaccesses (de, en, it, admin) and is using host based mapping for siteaccess detection (www.example.com, en.example.com, admin.example.com, ...). This is working fine so far, however I have a little problem with language switching and content being delivered on translated and untranslated URLs which leads to duplicate content. An example:

I am on www.example.com/karriere (de) and want to switch to the english site and click on the languageswitcher for the en siteaccess. The link is www.example.com/switchlanguage/to/en/karriere

When I access the english career page without the language switcher, the URL is en.example.com/career. However, the language switcher redirects me to en.example.com/karriere. This basically works (user gets to the right site), but is quite ugly in terms of consistency and SEO (same content reachable through multiple URLs).

Is there a setting/extension/other possibility to:

  • either set up the language switcher to redirect to the correct translated URL
  • or (even better) let nodes check if their URL is the translated one and otherwise send a 301 redirect to the translated one

Thanks,
Mathias

Roman Hutterer

Monday 22 August 2011 5:31:56 am

there exists an operator to avoid this ...
http://projects.ez.no/fetch_multilingual_url_alias_by_locale

hope that 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 29 2025 13:30:36
Script start
Timing: Jan 29 2025 13:30:36
Module start 'layout'
Timing: Jan 29 2025 13:30:36
Module start 'content'
Timing: Jan 29 2025 13:30:36
Module end 'content'
Timing: Jan 29 2025 13:30:36
Script end

Main resources:

Total runtime0.0140 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0053 588.6172151.2734
Module start 'layout' 0.00530.0018 739.890636.7656
Module start 'content' 0.00700.0058 776.656390.4375
Module end 'content' 0.01290.0012 867.093829.9766
Script end 0.0140  897.0703 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002316.0326140.0002
Check MTime0.00107.3797140.0001
Mysql Total
Database connection0.00096.593710.0009
Mysqli_queries0.001510.951530.0005
Looping result0.00000.064510.0000
Template Total0.00096.510.0009
Template load0.00075.126910.0007
Template processing0.00021.331010.0002
Override
Cache load0.00053.687310.0005
General
dbfile0.001611.634080.0002
String conversion0.00000.042440.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