guillaume
guillaume

Reputation: 1678

ZendFramework Error 404 on controller page

I'm trying to start a new project with Zend Framework 1.11 and I can access to the index controller with a URL like localhost/project/public/ . But with an URL like localhost/project/public/index/ I've a 404 error. To fix the problem I've to update or create a .htaccess file or update php.ini ?

Thanks

Upvotes: 2

Views: 882

Answers (2)

Anbarasu N
Anbarasu N

Reputation: 11

If you are getting 404 errors when going to any page other than the home page, please make sure that you have set AllowOverride to All in your Apache configuration and have enabled the mod_rewrite extension.

Upvotes: 1

ryan
ryan

Reputation: 333

By default execution starts from indexAction() in IndexController.To access indexAction() the url should be like http://localhost:8080/index. What happens when we run the project zend sees that index is appended to localhost then it assumes it as a controller.So it goes to IndexController and if we dont provide the action in url then it acceses the indexAction() method. For example if you give url as locahost/admin/submit then zend executes the submitAction() of AdminController.So you should change your url to locahost/index if u want to run indexAction() of IndexController.

Upvotes: 0

Related Questions