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?
|