Forum Moderators: phranque

Message Too Old, No Replies

302/301 for automatic language delivery

What it`s best?

         

bbbandit

2:44 pm on Oct 6, 2005 (gmt 0)

10+ Year Member



I have a multi-lingual website and like to automatically deliver the contents in the clients for preferred language. I have the little flags on the pages to allow manual selection.
So i have several www.mydomain.es/en/de/pt/fr each one redirect for each [mydomain.com...]
But iam not sure i need to use 301 in this case. Because i want the keywords in different languages, if use 301 (permanent redirect)what happen?

Thanks for any help

jdMorgan

7:02 pm on Oct 6, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'd suggest you don't use an external redirect of any kind, as this will confuse search engines and possibly users as well.

Two methods come to mind:

First you could change your site to use 'search engine friendly' URLs, like http://www.example.com/fr/index.php and then internally rewrite those requests to /index.php?language=fr when they are requested by users and search engines. This is a simple mod_rewrite exercise.

The second method would be to set up subdomains for each language, such as http://espanol.example.com/index.php, and again internally rewrite requests for that subdomain to /index.php?language=es.

Either way, you'll need to change the links on your pages to the 'friendly' version of the URL, and then use mod_rewrite to create the proper language query string to call your script when that friendly URL is requested.

This avoids the problem of having differrent-language content appearing at the same URL.

Jim

dragonthoughts

7:08 pm on Oct 6, 2005 (gmt 0)

10+ Year Member



Depending on your server version, it might be worth reorganising your site to let the server do the content language negotiation. Then it becomes transparent.

see [httpd.apache.org...]
for more details.

Note that there were some changes to this between versions 1.3 and 2