Rudra
Rudra

Reputation: 364

zend controller - page not found

I am new to Zend framework. I am using the Zend 1.12 framework in Ubuntu 12.04. I have installed the zf tool and it is working fine. I created the controller using:

zf create controller test

It created the controller in my controller folder and view in the respective directory.

But the problem is when I am using this url:

http://localhost/zftest/public/index/index

it worked well and opened the default view of Zend.

But when I try to open the custom controller:

http://localhost/zftest/public/test

it gives me an error:

Not Found

The requested URL /zftest/public/test was not found on this server.

Apache/2.2.22 (Ubuntu) Server at localhost Port 80

This is the link which helped me configure Zend: zend configuration

Upvotes: 3

Views: 1894

Answers (1)

kuldeep.kamboj
kuldeep.kamboj

Reputation: 2606

You must first set the AllowOverride directive from None to All in apache virtual host file. In you case your host is localhost. So file will be /etc/apache2/sites-enabled/000-default. See entry like

<Directory /var/www/>

You will found AllowOverride directive. Set it like

AllowOverride All

Then restart apache

sudo service apache2 restart

Then refresh Page.

Upvotes: 3

Related Questions