To me the route configuration looks correct and it should show results. What I noticed is that your base URL (localhost/dealproject/
) for the ZF2 application is in a sub directory of the domain's root. As you probably know all the requests are mapped to the index.php of your application (~/public/index.php
). This is done by some configuration in your .htaccess
file (in the same directory).
In the example URL www.example.com/blog
if blog
doesn't exists as a folder under www.example.com's root you get a 404 Page not found
. However, the .htaccess of ZF2 makes apache call the index.php in the domain's root if no directory is found (this assumes you use the ZendSkeletonApplication).
Now, since your index.php is not in the domain root (localhost/
) but in localhost/dealproject/
and your .htaccess is (I assume) in localhost/dealproject/
as well, when you call localhost/dealproject/deals
apache is looking for a directory dealproject/deals
since in localhost
there is no .htaccess to prepare the necessary configuration.
I would advise you to make dealproject
folder the root of localhost
. This will enable you to call your route like this: localhost/deals
and .htaccess and index.php will be processed correctly.
Hope this helps :)
Stoyan