Page 1 of 1

Multiligual & multi domain... how ?

Posted: Mon Mar 26, 2012 10:30 am
by kube
Hello,

I need a setup that can handle multidomains and multiple languages...

For now i've been testing with this structure with Babel, MtlCMS and Multidomain modules with no luck:

- Domain 1
--language
---pages
-Domain 2
--language
---pages
...


Any ideas / clues how to do that ?

Tx

Re: Multiligual & multi domain... how ?

Posted: Mon Mar 26, 2012 12:05 pm
by staartmees
I usually install for each language a cms e.g. cms-en, cms-fr, ... or take a look at http://www.i-do-this.com/blog/25/Anothe ... CMSMS-Page

Re: Multiligual & multi domain... how ?

Posted: Mon Mar 26, 2012 12:56 pm
by manuel
Theoretical suggestion:
Wouldn't it be possible to set the "root alias" for the different languages in Mle CMS to "redirecting links" sending visitors to the correct domain?
All domains should off course point to the same cmsms install. (Just realised this could create a loop :) Make sure to use the "redirecting links" to send users to the main pages for the languages, not to the "redirect" page!)

I'm not certain about the links created by the wysiwyg and in the menu... If they are "relative" you should be fine, if they are "absolute" they will redirect the visitor back to the main domain so you should look in to that.

You will also need to customize the "Multilang template" and generate your own URL's to allow users to switch languages (and domains).
Now, the $lang_href value does it all for you.

Every record in the "foreach from=$langs item=lang name=language" in the "Multilang template" contains the following information:
->0 = Array (5)
id => "1"
name => "Nederlands"
locale => "nl_NL"
flag => "images/MleCMS/Belgium-32.png"
alias => "welkom"

You will need to write something like this instead of using the regular $lang_href:
IF $lang_locale = "nl_NL"
domain1.com/$alias
ELSEIF $lang_locale = "fr_FR"
domain2.com/$alias


ps: you will have to make sure you Google doesn't penalize you for duplicate content however! Maybe setting up cannonnical links would be enough, maybe not... Just warning you...

Let me know if it works out for you! :)

Greetings,
Manuel

Re: Multiligual & multi domain... how ?

Posted: Tue Apr 03, 2012 5:57 pm
by kube
Thanks for your replies.
For now i've been testing mlecms module + Multidomains module and it works allright. 8)
Had to use the following structure:

languageA
- domain1
--pages
- domain2
--pages
languageB
- domain1
--pages
- domain2
--pages


Now the problem i have is with the url: "http://www.domain.com/domain/language/page

See ? i have a repetition. Now i have the feeling i can strip that using some .htaccess magic, but i am still a newbie concerning rewriting rules...
Any ideas how to do that ? ???

Re: Multiligual & multi domain... how ?

Posted: Wed May 09, 2012 7:36 pm
by manuel
Dear Kube,

I don't think .htaccess is the way to go as the CMS will still generate the incorrect URL's so they will always remain visible to the search engines and visitors even when you would succeed in removing the directory with .htaccess.

If i'm correct the links will still work when you manually remove the duplicates correct?
Original: "http://www.domain.com/domain/language/page"
Also works? "http://www.domain.com/language/page"

I believe you will need to use regex replace on all the variables containing URL's in all modules that generate URL's... (menu manager, search, news, cgblog, sitemapmadesimple, ... just about any module you use i guess...)

Here is the regex that should do that:

Code: Select all

{$theVarContainingTheURLyouWantToChange|regex_replace:"/(\/domain\/)/":"/"}
I don't believe you have to escape the / you will replace the /domain/ with but if you need to to this, use the following code:

Code: Select all

{$theVarContainingTheURLyouWantToChange|regex_replace:"/(\/domain\/)/":"\/"}
I almost forgot the links generated by the wysiwyg will also need to be corrected...
You should be able to use the following in your website template:

Code: Select all

{content assign="capturedcontent"}{$capturedcontent|regex_replace:"/(\/domain\/)/":"\/"}
ps: All this regexing will certainly take a large toll on the performance but i hope caching will help out some. It should probably still only be used on smaller sites... This is all untested, let me know what you find!

To test the performance:
Add the following to your config.php, clear the cache and refresh (2 or 3 times according to calguy ;D I haven't tested this myself yet...)

Code: Select all

$config['show_performance_info'] = 1;
Greetings,
Manuel