How to create multiple multilingual sites in one install?

Author Message

Marc Boon

Thursday 12 January 2006 9:55:20 am

I'm currently evaluating eZ Publish for a rather large project with two multilingual sites using shared content.
I tried for a few days to set this up, but didn't find a complete solution. Can anybody help?

This is the situation:

site1.com/ # default (english) version of site1
site1.com/en/ # same as above
site1.com/de/ # german version of site1
site1.com/es/ # spanish version of site1
site1.com/admin/ # admin site for site1

site2.com/ # default (english) version of site2
site2.com/en/ # same as above
site2.com/fr/ # french version of site2
site2.com/ar/ # arabic version of site2
site2.com/admin/ # admin site for site2

I first tried a combination of host and uri matching (settings/override/site.ini.append.php):

[SiteAccessSettings]
MatchOrder=host;uri

But this doesn't work, because when a host match is found, the uri is not evaluated. The other way around also doesn't work:

MatchOrder=uri;host

When a uri match is found, the host is not evaluated, and you don't know which site the uri belongs to (both sites have /en/ for example).

Then I tried a combination of servervar and host matching, and using Apache to set the servervar (both sites have the same DocumentRoot):

MatchOrder=servervar;host
ServerVariableName=SITE_ACCESS
HostMatchType=map
HostMatchMapItems[]=site1.com;site1_en
HostMatchMapItems[]=site2.com;site2_en

The server variable is set by Apache using the SetEnvIf directive (using mod_setenvif):

In the <VirtualHost> section or .htaccess for site1:

SetEnvIf Request_URI ^/de/ SITE_ACCESS=site1_de
SetEnvIf Request_URI ^/es/ SITE_ACCESS=site1_es
SetEnvIf Request_URI ^/admin/ SITE_ACCESS=site1_admin

In the <VirtualHost> section or .htaccess for site2:

SetEnvIf Request_URI ^/fr/ SITE_ACCESS=site2_fr
SetEnvIf Request_URI ^/ar/ SITE_ACCESS=site2_ar
SetEnvIf Request_URI ^/admin/ SITE_ACCESS=site2_admin

When no language is specified, the server var SITE_ACCESS is not set, so the servervar match fails, and the host matching takes care of the default site access (MatchOrder=servervar;host).

Site access works now, but the language/admin part is interpreted as a module, with a 'module not found' error as a result. I tried fixing this using the PathPrefix setting, but that didn't work.

Any suggestions?

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 18 2025 04:28:14
Script start
Timing: Jan 18 2025 04:28:14
Module start 'layout'
Timing: Jan 18 2025 04:28:14
Module start 'content'
Timing: Jan 18 2025 04:28:16
Module end 'content'
Timing: Jan 18 2025 04:28:16
Script end

Main resources:

Total runtime1.4993 sec
Peak memory usage4,096.0000 KB
Database Queries46

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0059 588.1719152.6563
Module start 'layout' 0.00590.0031 740.828139.5078
Module start 'content' 0.00901.4888 780.3359416.8516
Module end 'content' 1.49780.0014 1,197.18758.0938
Script end 1.4992  1,205.2813 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00370.2450160.0002
Check MTime0.00140.0917160.0001
Mysql Total
Database connection0.00110.075010.0011
Mysqli_queries1.428895.3024460.0311
Looping result0.00050.0353440.0000
Template Total1.460297.420.7301
Template load0.00210.143220.0011
Template processing1.458197.251520.7290
Template load and register function0.00010.006710.0001
states
state_id_array0.00100.067810.0010
state_identifier_array0.00180.119320.0009
Override
Cache load0.00180.1169310.0001
Sytem overhead
Fetch class attribute can translate value0.00090.062510.0009
Fetch class attribute name0.00050.035710.0005
XML
Image XML parsing0.00010.008710.0001
class_abstraction
Instantiating content class attribute0.00000.000210.0000
General
dbfile0.00070.0481100.0001
String conversion0.00000.000740.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
1content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
3content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
8content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
5content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 19
 Number of unique templates used: 6

Time used to render debug report: 0.0002 secs