Not fund .js, .png, .css and so on handled as index
There is bug in dispatcher. Have both event types attached to dispatch event:
if ($event->getType() == 'beforeNotFoundAction') and if ($event->getType() == 'beforeException')
url.com/js/main - is forwarded to IndexController->notFoundAction url.com/js/main.js - handled as IndexController->indexAction
basically any url with an .ext if not found on server is handled as index/index
for example: http://www.phalconphp.com/img/lalala.png
Hi JohnnyAjax, this is not a bug, you need to change the default routes to allow the dot character on them:
$route = new Phalcon\Mvc\Router(false);
$router->add('/:controller', array(
'controller' => 1
));
$router->add('/:controller/([a-zA-Z0-9\_\.]+)(/.*)*', array(
'controller' => 1,
'action' => 2,
'params' => 3
));
However, using the dot in the controller/namespace or action is not recommended since those parameters are passed to an autoloader it would lead to open the possibility to read unauthorized files in your application.
I would like it to be forwarded as 404 - as any not found controller/action
I think http://www.phalconphp.com/lalala/lalla.jpg should be handled as http://www.phalconphp.com/lalala/lalla and not index page.
I added a safe fix in 0.8.0 to handle the routes as you need