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

short url service

Hello! I have a task cut url for example:


on the:


I have a router file:

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

 '/r_([A-Za-z0-9] {8})',
 'controller' => 'index',
'action'     => 'index',
 'alias' => 1

return $router;

I get the error:

RHyft64KlController handler class cannot be loaded

Very good it would be to get a link without prefix "r_"


How do I configure the router?

well your kind of doing it wrong, its trying to locate the controller based on the url so try:

router file :

$router->add("/r_{shorturl:[a-zA-Z0-9\_\-]+}", [
  "namespace"  => "Api\Controllers", //  what ever you have named your namespace
  "module"     => "Api", // module of that app , not necessary but good to specify
  'controller' => 'index',
  'action'     => 'index'