We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

What am I doing wrong!?

Hey, I'm new to Phalcon. Here's my embarrassing situation.

class IndexController extends \Phalcon\Mvc\Controller
{
    public function indexAction() { echo 'The index page'; }
}
class SignupController extends \Phalcon\Mvc\Controller
{
    public function indexAction() { echo 'The signup page'; }
}

Ok, so everytime I go to -> localhost:8000 (The indexAction from the IndexController is called. Great!)

But, when I go to -> localhost:8000/signup (The indexAction from the IndexController is called. wait..WHAT!?)

Why!? Is it just me or am I missing something?

Welcome to Phalcon.

How do you have your vhosts, directory structure, and .htaccess files setup? Everything is being routed to your bootstrap file but it appears as if the params aren't being passed, so, no matter what you do, it's going to index/index. This is a strange error, but, you aren't missing anything obvious. Phalcon MVC functions much like any other MVC framework in that it goes to index if no action is specified and index/index if no action or controller is specified.

If you provide that information, I'm sure I can spot the problem.

From the code provide I have to agree with Brian.

Hey!

Sorry for my late response...

I don't use vhost. I use the PHP 5.4 built-in web server. I'll try and get WAMP server and see if the problem still exists! Thanks guys!

will report back!

Hmmm..... It works when I use WAMP...How strange! Anyone having issues with this using the PHP 5.4 built-in web server?

It's actually less an issue with the built-in server and more an issue with the built-in server doesn't contain mod_rewrite (or a suitable alternative to URL re-writing).

I had a little dig about and this looks like it might be of some help when trying to get mod_rewrite working with PHP 5.4 webserver

https://gonzalo123.com/2012/10/15/how-to-rewrite-urls-with-php-5-4s-built-in-web-server/

or this gist

https://gist.github.com/ssokolow/3057918