language detection by subdomain |
[eluser]deck1[/eluser]
This is my approach: First of all, at top of index.php I filter all request without subdomain. trying to avoid duplicate pages e.g.: domain.com vs www.domain.com: Code: $safe_http_host = strtolower(preg_replace("/[^a-zA-Z0-9\_\-\.]/", "" , $_SERVER['HTTP_HOST'])); Well, now we have a clean subdomain. The next step is to detect language in url. I use a hook (i use language code in first segment), but the process is the same: Code: /* Once you have $language, you can assign it to a session varibale, load language files, etc. |
Messages In This Thread |
language detection by subdomain - by El Forum - 05-23-2008, 09:38 AM
language detection by subdomain - by El Forum - 05-23-2008, 03:50 PM
language detection by subdomain - by El Forum - 05-24-2008, 04:17 AM
|