title: Language as subdomain with Zend 1.9
body: <p>I am playing with Zend 1.9 and would like to have the language parameter as subdomain.</p>
  
  <p>Like : <a href="http://en.site.com" rel="nofollow noreferrer">http://en.site.com</a></p>
  
  <p>Is it possible to get the language in .htaccess and set it to an environment variable which I can use in Zend ?</p>
  
  <p>What is the best way to achieve what I want ?</p>
  
  <p>-- added --:</p>
  
  <p>I added this into my routes.ini :</p>
  
  <pre><code>[routes]
  
  routes.lif.type = "Zend_Controller_Router_Route_Hostname"
  routes.lif.route = ":language.domain.:tld"
  routes.lif.reqs.language= "[a-z]{2}"
  routes.lif.defaults.controller = "index"
  routes.lif.defaults.action = "index"
  routes.lif.defaults.language = "en"
  
  ; default
  routes.lif.chains.default.type = "Zend_Controller_Router_Route"
  routes.lif.chains.default.route = "/:controller/:action"
  routes.lif.chains.default.defaults.controller = index
  routes.lif.chains.default.defaults.action = index
  
  ; register
  routes.lif.chains.register.type = "Zend_Controller_Router_Route"
  routes.lif.chains.register.route = "/register"
  routes.lif.chains.register.defaults.controller = "register"
  routes.lif.chains.register.defaults.action = "newuser"
  
  ; details
  routes.lif.chains.band.type = "Zend_Controller_Router_Route"
  routes.lif.chains.band.route = "/details/:name"
  routes.lif.chains.band.defaults.controller = "details"
  routes.lif.chains.band.defaults.action = "getdetails"
  </code></pre>
  
  <p>This is working well if I go to : <a href="http://en.domain.com/details/joe" rel="nofollow noreferrer">http://en.domain.com/details/joe</a>
  But unfortunatly if I remove subdomain : <a href="http://domain.com/details/joe" rel="nofollow noreferrer">http://domain.com/details/joe</a> the default action is not called and I get </p>
  
  <p>Message: Action "joe" does not exist and was not trapped in __call()</p>
  
  <p>Do you have an idea ?</p>
  
  <p>Thanks guys.</p>
  
  <p>Thierry</p>