PHP Phalcon Routing with file extension

我与影子孤独终老i 提交于 2019-12-12 04:22:01

问题


In my PHP Phalcon 3 Application I have a custom route:

$router->add("/{chapter}/{name}.{type:[a-z]+}", array(
        "controller" => 'images',
        "action" => 'getFile',
    ));

I test the application local with PHP Builtin Server, other routes are working regulary. If i test the route above: http://localhost:8000/XYZ/test.jpg I always get a 404. But in regards to the documentation it should work: https://docs.phalconphp.com/en/latest/reference/routing.html

Do you have any idea whats wrong?

This is my .htrouter for the php built in server:

<?php

if (!file_exists(__DIR__ . '/' . $_SERVER['REQUEST_URI'])) {
    $_GET['_url'] = $_SERVER['REQUEST_URI'];
}
return false;

来源:https://stackoverflow.com/questions/39722558/php-phalcon-routing-with-file-extension

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!