views:

470

answers:

1

Hello,

I've got a really weird problem with ZF (at least for ZF newbie): I can not access my existing controller and its action method.

No problems with: localhost/
localhost/index
localhost/index/index
localhost/index/about

But, I've set route like this: /localhost/test, pointing to index controller and indexAction and I see 404 every time I access it.

404 is not handler by zf (at least it looks like this), I get plain old apache2 notfound page with my apache and php versions there. In error log for such request I see: "File does not exist: /var/www/test"

Bootstrap route init:

class Bootstrap extends Zend_Application_Bootstrap_Bootstrap { protected function _initDoctype() {

    $this->bootstrap('view');
    $view = $this->getResource('view');
    $view->doctype('XHTML1_STRICT');
}

protected function _initRoute() {
    $ctrl = Zend_Controller_Front::getInstance();
    //$ctrl->setParam('useDefaultControllerAlways', true);
    $router = $ctrl->getRouter();
    //$router->removeDefaultRoutes();
    $router->addRoute(
    'test',
    new Zend_Controller_Router_Route_Static('test',
    array('controller' =>'index', 'action' => 'index',
    'module' => 'default')));
    }

    }

So as far as I can get, problem is probably with apache2. .htacess is default, just like in docs. Here is it:

SetEnv APPLICATION_ENV development

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]

Thanks

A: 

apache was improperly configured, reconfiguration solved the problem

Vladimir Shulyak