Re: How do search engines index multilingual content?
- From: "Alan J. Flavell" <flavell@xxxxxxxxxxxxxxxxx>
- Date: Fri, 3 Feb 2006 12:27:11 +0000
On Thu, 2 Feb 2006, Manfred Kooistra wrote:
Alan, after reading your article and the relevant apache docs, I have
been trying to redirect visitors of my home directory to different
subdirectories, depending on the accept language header sent by the
browser.
MultiViews already works well, but it doesn't care for that kind of
structure.
For this I wrote a .htaccess file with the following content:[...]
RewriteCond %{HTTP_ACCEPT_LANGUAGE} ^de [NC]
RewriteRule ^/ http://www.domain.com/de/ [L,R=301]
When I said before that:
||Apache's content negotiation already forms the basis of doing it
||properly. Every botch that I've seen yet in CGI or PHP scripts has
||had at least one gaping error in it.
- I should have included mod_rewrite in that list!!!
Here's what I believe to be a protocol-correct languages preference
header:
Accept-language: de;q=0,fr-CA,fr;q=0.5
That says the reader prefers Canadian French, failing which they'll
accept generic French, but under no circumstances do they want German.
It's left as an exercise to the student to work out what your rewrite
recipe will do for them.
(I understand the approach with AddLanguage and different files with
language code extensions, e.g. index.php.de and index.php.en, but I
would prefer to direct to subdirectories instead.)
I *think* you could implement that by means of a type-map file; or you
could create a bundle of symlinks in a collective subdirectory,
pointing to the various language-specific subdirectories; but, if you
do that, take care that relative URLs get resolved correctly. I
haven't actually tried either approach in practice myself, so YMMV.
MultiViews actually works pretty well for most kinds of requirements;
there were a few little glitches in Apache 1.3 versions - in as much
as a pedantic interpretation of the negotiation rules could result in
some surprises in practice, such as all those USA users who would be
told there's nothing available for them (because they refused generic
English), but my page shows ways to get around that. I think in
Apache 2.0 the algorithms have been tweaked a bit, to get better
practical results without needing workarounds.
good luck
.
- Follow-Ups:
- Re: How do search engines index multilingual content?
- From: Manfred Kooistra
- Re: How do search engines index multilingual content?
- References:
- Re: How do search engines index multilingual content?
- From: Dr John Stockton
- Re: How do search engines index multilingual content?
- From: Alan J. Flavell
- Re: How do search engines index multilingual content?
- From: Manfred Kooistra
- Re: How do search engines index multilingual content?
- Prev by Date: Re: How do search engines index multilingual content?
- Next by Date: Re: How do search engines index multilingual content?
- Previous by thread: Re: How do search engines index multilingual content?
- Next by thread: Re: How do search engines index multilingual content?
- Index(es):
Relevant Pages
|