Domanda

Background

My company is about to undertake the internationalization of its corporate website (with approx 3000+ pages of static content per language). My current question is regarding the serving of internationalized static content from the Apache Web Server (v2.4.1).

Apache Documentation

While reading the documentation I have learned that Apache supports the serving of multi-language content through the addition of the language code at the end of the filename, eg:

index.html.en
index.html.zh
index.html.kr

(the codes are just for illustration, they may well be incorrect)

Content Structure

However our static content is managed within our Documentum WCM, and my Documentum team inform me that when pushing the content onto our web servers, the WCM would output it's data in the following structure:

.../en/full/content/tree.html
.../kr/full/content/tree.html
.../ja/full/content/tree.html
.../zh/full/content/tree.html

My Problem/Question

So, what I would like to know is how can I configure the Apache HTTP Server to serve content from a different content tree, based on the TLD that the user requests, meaning that if a user requests the URL: http://www.mycompany.cn/full/content/tree.html it would serve the content from the .../zh/.... tree. Notice that the language code does not appear in the URL - in fact all URLs should remain the same, with the exception of the domain name.

In other words, the TLD used to access the content, dictates the language being shown.

We would be starting with probably the following domain TLDs:

http://www.mycompany.com
http://www.mycompany.cn
http://www.mycompany.co.kr
http://www.mycompany.com.tw
http://www.mycompany.co.jp

I'm sure this is not a completely uncommon approach, but I'm a little at a loss at how to proceed with this, so any help you could provide would be gratefully received.

Thanks,

Note: I do not need answers on whether the approach of forcing specific domains to serve specific language content is the best approach - this has already been debated internally and decided - I lost.

È stato utile?

Soluzione

Turns out this is very easy - all that is needed is to define multiple VirtualHost's, one for each TLD, and point it at a different DocumentRoot.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top