How to handle language ?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

How to handle language ?

help_poor
There are two ways to handle language selection:

1) language.domain.com
- this is more SEO friendly, as my url stays according to blog posted title


2) www.domain.com/language
- this is not SEO friendly + from Views its very difficult to handle links like < a href=/english or dutch/posted-title>hello world< /a>


How can i do from bootstrap.php method 1 ? Where www.domain.com -> when nothing is found becomes http://en.domain.com
If the browser is dutch it will become www.domain.com -> redirect as -> http://nl.domain.com


Question: How can i now use $this->_redirect()  inside Bootstrap.php ?

  protected  function _initRoute()
  {
    $front = Zend_Controller_Front::getInstance();
    $router = $front->getRouter();
Reply | Threaded
Open this post in threaded view
|

Re: How to handle language ?

Jurian Sluiman-4
On Sunday 02 Jan 2011 18:59:10 help_poor wrote:

> There are two ways to handle language selection:
>
> 1) language.domain.com
> - this is more SEO friendly, as my url stays according to blog posted title
>
>
> 2) www.domain.com/language
> - this is not SEO friendly + from Views its very difficult to handle links
> like < a href=/english or dutch/posted-title>hello world< /a>
>

Please explain why subdomains are more SEO friendly than a path. I think a
language is an integral part of a website and (for example) an English or
Dutch website isn't a different one with regard to domain names.

Links can be set to an arbitrary url without language-part when you have a
<base> element in your <head>. I set my base to http://mydomain.tld/en/ when I
show my English version of my site.

> How can i do from bootstrap.php method 1 ? Where www.domain.com -> when
> nothing is found becomes http://en.domain.com
> If the browser is dutch it will become www.domain.com -> redirect as ->
> http://nl.domain.com
>
>
> Question: How can i now use $this->_redirect()  inside Bootstrap.php ?
>
>   protected  function _initRoute()
>   {
>     $front = Zend_Controller_Front::getInstance();
>     $router = $front->getRouter();

Use hostname routes to detect the subdomains:
http://framework.zend.com/manual/en/zend.controller.router.html#zend.controller.router.routes.hostname

Still, I'd suggest a part of your path instead of subdomains (eg consider page
ranks of your subdomains!).

Regards, Jurian
--
Jurian Sluiman
Soflomo - http://soflomo.com
Reply | Threaded
Open this post in threaded view
|

Re: How to handle language ?

help_poor
@Jurian Sluiman, others,

I find it in my way because, if i see large companies like dell/google and facebook. They follow Subdomain method. Not the uri formula.

1. Why subdomain ? ex: you are searching "seo friendly" from a google.com = english network or google.fr =  french network)
- they will look for the domain name database field first, then they look for the uri first
- if you put junks in uri, you are somewhere else
- but if its unique url based on subdomain, you are providing more search friendly structure

Example is recommended:
en.domainname.com/seo-friendly-texts  <--- this title stays always same
fr.domainname.com/seo-friendly-texts  <--- this title stays always same

Render:
from subdomain we know which language, and from uri title we know which content.


Thanks