Hey guys! I'm designing this multi-lingual site with php + mysql. I'm using a 2 letter language code following the domain name to identify the language the content is delivered in. For example,
www.domain.com/en - English
www.domain.com/th - Thai and so on...
All URLs (am utilizing mod_rewrite) take the general form,
http://www.domain.com/2_char_languag...page_slug.html
Here's my problem scenario:
When person A visits the site by keying in www.domain.com/lang_code, I can directly serve the pages in the desired language.
If person A keys in just www.domain.com (without any language code), I redirect to the english page by default - but I'm in a dilemma as to what redirection header to serve for this URL. I had read about a '300 Multiple Choice" header and that's what I have implemented experimentally.
Here's the code:
PHP Code:
header( 'HTTP/1.1 300 Multiple Choices' ); header( 'Location: ' . DOMAIN . '/en' );
Is this the correct way to do it?
I had thought of using a 301 earlier on - but that didn't strike quite right.
Has anyone worked on such a case and can throw some light on this?
Thanks,
m^e
__________________
PeoPLe aRe cRazY anD tiMeS aRe sTRaNGe, i'M LoCKeD iN tiGhT, i'M OuT oF raNGe, i uSeD t0 caRe BuT - thiNGs haVe ChaNGeD.
Please login or register to view this content. Registration is FREE ... Technology News & Reviews
|