I have problem with 'dynamic subdomains' on zend_router_hostname, i have code like(i don't have subdomains like that but whant use subdomain as route parametr):
protected function _initRoutes() {
$front = Zend_Controller_Front::getInstance();
$router = $front->getRouter();
$config = $this->getOptions();
Zend_Registry::set("config", $config);
$routerHost = new Zend_Controller_Router_Hostname(':language.mysite.local',
array('controller' => 'index',
'action' => 'index',
'language'=>'pl')
);
$router->addDefaultRoutes();
$routes = $router->getRoutes();
foreach ($routes as $key => $routeEntry) {
$router->addRoute($key, $routeHost->chain($routeEntry));
}
}
But when I try do call eg.: pl.mysite.local i get Server not found error. My /etc/hosts file is:
127.0.0.1 localhost
127.0.2.1 mysite.local
127.0.3.1 mysite.dev
127.0.4.1 mysite.production
And my vhost config is:
VirtualHost *:80>
DocumentRoot "/var/www/mysite/public"
ServerName mysite.local
ServerAlias *.mysite.local
# This should be omitted in the production environment
SetEnv APPLICATION_ENV development
<Directory "/var/www/mysite/public">
Options Indexes MultiViews FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
I tried to use dnsmasq with entry like:
address=/local/127.0.0.1
But problem still occurs, i dont know how to resolve this situation, any clue what i'm doing wrong?