Zend Framework主机名路由和默认路由

I created a Hostname route like this:

$siteRoute = new Zend_Controller_Router_Route_Hostname(
    ':siteSlug.wordy',
    array(
        'siteSlug' => 'main-site',
        'module' => 'default'
    )
);

and i chain it with default and other rotues like this:

foreach ($router->getRoutes() as $key => $route) {
    $router->addRoute($key, $siteRoute->chain($route));
}

The problems are:

When i got to main-site.wordy there is no problem. but if i go to just wordy i get this error message: No route matched the request

And the other problem is when i go to wordy/admin i get this exception: Invalid controller specified (admin)

How can i solve this?

I suggest u to make a htaccess redirect for non www url to 301 redirect on www.wordy in this way u always have :sitename for router hostname !

RewriteEngine On

RewriteCond %{SERVER_PORT} ^80$
RewriteCond %{HTTP_HOST} ^wordy$ [NC]
RewriteRule ^(.*)$ http://www.wordy/$1 [R=301,L]