Forums / Developer / Running two multilingual sites on a single ezp installation

Running two multilingual sites on a single ezp installation

Author Message

Sebastiaan van der Vliet

Saturday 14 August 2004 2:34:04 am

Hi,

Can anyone tell me if the setup described below is potentially problematic/stupid? Can this be done in a different (read: easier) way?

I'm trying to run two multilingual (dutch, french) sites on a single installation. The setup is as follows: www.site1.com/nl, www.site1.com/fr and www.site2.com/nl, www.site2.com/fr (I don't want to use subdomains).

My problem: With this setup is that I have four siteaccesses, with overlapping names (double "nl" siteaccess and "fr" siteaccess). So I renamed my siteaccesses to site1_nl, site1_fr and site2_nl, site2_fr. But since I do not want urls like: www.site1.com/site1_nl or www.site2.com/site2_fr I had to do the following:

I modified access.php as follows (line 103):

$name = implode( '_', $elements );

to

$hostname=explode(".",$host);
$name=$hostname[1]."_".implode( '_', $elements );

Which results in the url www.site1.com/fr being translated into site1_fr, the name of the siteaccess then used. The siteaccess name is used to create links, so to avoid all links on the page still being written as www.site1.com/site1_nl I added the following lines to file ezutils/classes/ezsys/ in function addAccessPath (line 696):

$modified_path=explode("_",$path);
$path=$modified_path[1];

which results in the siteaccess in the links on the page changed into "nl" or "fr" again (e.g. www.site1.com/nl/news/demo_news_1).

The override/site.ini setup is as follows:

URIMatchType=element
AvailableSiteAccessList[]
AvailableSiteAccessList[]=site1_nl
AvailableSiteAccessList[]=site1_fr
AvailableSiteAccessList[]=site2_nl
AvailableSiteAccessList[]=site2_fr
AvailableSiteAccessList[]=admin

It works but it seems a bit dirty to me.

Thanks for your time,
Sebastiaan

Certified eZ publish developer with over 9 years of eZ publish experience. Available for challenging eZ publish projects as a technical consultant, project manager, trouble shooter or strategic advisor.

Hapee de Groot

Sunday 29 August 2004 1:20:10 pm

Any comments on this? It could help us a lot!

Marc Boon

Thursday 19 January 2006 7:59:10 am

I know this topic is a bit old, but I haven't seen a good answer, and I have the same problems setting up a muli-site multi-language system.

I tried to work around the problem by using 2-letter language codes for site1, and 3-letter codes for site2.

Problem is: you have to make sure that the user doesn't end up in the wrong site if he/she uses the 2-letter code instead of the 3-letter one or vice-versa.

I tried to fix this using also host matching, but the combination of host and uri matching (MatchOrder:host;uri) doesn't work. See my other post (still unanswered):
http://ez.no/community/forum/install_configuration/how_to_create_multiple_multilingual_sites_in_one_install