Have you set up the rewrites properly?

On Wed, Oct 15, 2008 at 16:54, Bobby703 <[EMAIL PROTECTED]> wrote:

>
> Hi all,
>
> I just start learning zend and created a very simple hello world app.
> So when I access http://localhost/zendtest/web_root, it will go to default
> indextAction of IndexController
> That works.
> However, I can get my TestController working as when I access
> http://localhost/zendtest/web_root/test
> it should go to find TestController and indextAction inside it. But I got
> "Not Found
> The requested URL /zendtest/web_root/test was not found on this server."
>
> It should map this url to TestController and indexAction, shouldn't it? I
> tried to creat and access other
> controllers other than IndexController, they did not work at all. It seems
> only the default IndexController works
> for me and all actions in IndexController work too. What is the cause? Did
> I
> miss anything? I can only use IndexController so far.
> Other controllers I created all return "Not Found...." error messages.
> I can't figure out why the other controllers dont work as I can see they
> are
> in the controllers dir and I typed in the right url which should be mapped
> to them.
> Why it always complains "Not Found"? Anyone can give me some ideas?
>
> Sorry, it might be a very easy question  but I am new to Zend Framework.
> Thank you very much in advance.
>
>
>
> Here is my index.php in my web_root
>
> <?php
>
> date_default_timezone_set('Australia/Sydney');
>
> set_include_path('../library'.PATH_SEPARATOR.'../application/models/'.PATH_SEPARATOR.get_include_path());
> require_once"Zend/Loader.php";
> Zend_Loader::registerAutoload();
>
> $frontController=Zend_Controller_Front::getInstance();
> $frontController->setControllerDirectory('../application/controllers');
> $frontController->setBaseUrl('/zendtest/web_root');
> $frontController->throwExceptions(true);
>
> try{
>        $frontController->dispatch();
> }catch(Exception $e){
>        echo nl2br($e->__toString());
> }
>
>
> Here is my .htaccess file
>
> RewriteEngine On
> RewriteCond %{REQUEST_FILENAME} -s [OR]
> RewriteCond %{REQUEST_FILENAME} -l [OR]
> RewriteCond %{REQUEST_FILENAME} -d
> RewriteRule ^.*$ - [NC,L]
> RewriteRule ^.*$ index.php [NC,L]
>
> I created two controllers which are IndexController.php and
> TestController.php  They are identical and just have indexAction functions
> inside.
>
> <?php
> class IndexController extends Zend_Controller_Action
> {
>
>        public function indexAction()
>        {
>
>
>        }
>
> }
>
> <?php
> class TestController extends Zend_Controller_Action
> {
>
>        public function indexAction()
>        {
>
>
>        }
>
> }
>
> Here is the index.phtml under /views/test dir
>
> <p>This is a test page.</p>
>
>
>
>
> My web root is /var/www/zendtest/web_root
> The dir structure under /var/www/zendtest is as follow:
> ./application
>     /controllers
>                IndexController.php
>                TestController.php
>         /models
>         /views
>                /helpers
>                /layouts
>                /scripts
>                        /index
>                                index.phtml
>                        /test
>                                index.phtml
> ./library
>        /Zend
> ./web_root
>        /css
>        /img
>        /js
>        index.php
>        .htaccess
>
>
>
>
>
>
> --
> View this message in context:
> http://www.nabble.com/I-can%27t-access-other-controllers-tp19987183p19987183.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
>
>

Reply via email to