Reputation: 43
I did everything as it is written in the book of Vaswani V. - the Zend Framework. A Beginner's Guide (page 33), but the page "http://square.localhost/default/index/index" returns the response "not found". What is wrong?
Upvotes: 1
Views: 294
Reputation: 1010
I had the exact same problem with that part of the book. Fortunately, the book's companion site (zf-beginners-guide.com) has an errata/troubleshooting section that solves the problem nicely. Quoting from the site:
If you see a "File not found" error after implementing the modular directory layout and accessing the URL http://square.localhost/default/index/index, check that the new virtual host supports .htaccess overrides. You can enable this by adding the following lines to your virtual host configuration, remembering to change the directory path to your virtual host's document root.
<Directory "/usr/local/apache/htdocs/square/public">
AllowOverride All
Options All
</Directory>
Incidentally, if you're using Ubuntu, it may not have mod_rewrite enabled by default. (I just ran into the exact same problem myself BTW). If you're still having trouble, try this:
sudo a2enmod rewrite
sudo service apache2 restart
(Big thanks to Mahok for the help on that, BTW!)
Upvotes: 1