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

Custom routes stopped working under Unix

Here is my custom routes.php:

<?php

$router = new \Phalcon\Mvc\Router(false);

$router->add("/", array(
'controller' => 'session',
'action' => 'index'
 ));
$router->add("/session/start", array(
'controller' => 'session',
'action' => 'start'
));
 return $router;
?>

Redirecting to Session/Index works perfectly under Windows, but it started to re-direct to session/start for unknown reason when i go to root and view my site under Unix.

Can' understand why dispatcher started to re-direct the page to incorrect action under Unix. Please advise!

Hi, verifies that the file name is equal to the class, case sensitive....and rename!



14.9k
Accepted
answer

I got it, i was trying to directly access Session/Index in the address bar instead of going to root. That's why i was getting 404 page. There is an internal re-direct there.