Hello Everyone!

I've successfully setup a custom router that allows me to use sub-domains as
account key's. For example http://foo21.example.com get's routed to
www.example.com with an account param of foo21. However, when I add
additional parameters to the link, the router no longer works:

http://foo21.example.com/home/index (WORKS)
http://foo21.example.com/home/index?param1=value1 (WORKS)
http://foo21.example.com/home/index/param1/value1 (DOES NOT WORK, router
displays index controller and action irregardless of what's in the link)


I've read the article located at
http://www.noginn.com/2008/09/03/using-subdomains-as-account-keys/ as well
as this mailing list for as much information as I could find on the matter.
The following code is in my bootstrap file:

public function configureRouter()
        {
                $frontController = Zend_Controller_Front::getInstance();
                $router = $frontController->getRouter();
                $router->removeDefaultRoutes();

                $pathRoute = new Zend_Controller_Router_Route(
                    ':controller/:action/*',
                     array(
                          'controller' => 'index',
                          'action' => 'index'
                     )
                 );

                 $accountRoute = new Zend_Controller_Router_Route_Hostname(
                      ':account.localhost',
                       NULL,
                       array(
                            'account' => '([a-z0-9]+)',
                       )
                 );
                 $router->addRoute('default',
$accountRoute->chain($pathRoute));

        }

What am I doing wrong here? I've been playing around with the above code for
hours but nothing seems to work! Any help would be greatly appreciated!
-- 
View this message in context: 
http://www.nabble.com/Zend_Router-Question-tp25144950p25144950.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to