Daniel Groves
Daniel Groves

Reputation: 472

URL Routing in Zend

So, I've just started using Zend, moving our companies internal CMS over onto the new Framework, and if you saw the existing code I'm sure you would soon agree the best way to to scrap the whole thing and start over.

So, thats exactly what I'm doing. It's relatively small, so as projects go it shouldn't take too long. Anyhow, to get to the point:

How exactly does routing work in Zend?

I have created a project, and two Modules, one called "default" and one called "admin". If you haven't guessed already I'd like the default module to be the front end of the site, and the admin module to be the backend of the site. When I navigate to ~/public/ I can see the "Welcome to Zend Framework" screen, but when I navigate to ~/public/admin I just get a 404.

What am I missing to get this working? Also, how do I map ~/ to ~/public/ where ~/ is the domain?

As a note, I made the modules and an Index controller within each using the zf tools on the command line using the following commands:

zf create Module default
zf create controller Index -m default
zf create Module admin
zf create controller Index -m admin

Thanks and advance for any help your able to give.

Dan.

Upvotes: 0

Views: 101

Answers (1)

Tim Fountain
Tim Fountain

Reputation: 33148

'public' should not be in your URLs. Change your vhost so that the document root points at the public folder, not the application root folder, that will probably solve your problem. If not, make sure you have a .htaccess file which includes the mod_rewrite rules as explained in the manual, but if you used the command line tool to generate the project that part is probably fine.

Upvotes: 1

Related Questions