0

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;
ghovat
  • 1
  • 2
  • And you sure it's even hitting phalcon application ? – Juri Sep 27 '16 at 11:48
  • No i think the 404 comes from the built in server. But all other routes are handled by the application also if I change the file extension from .jpg to _jpg – ghovat Sep 27 '16 at 12:01
  • Well can't you just use nginx or apache ? Don't know why it's not routing with built-in php server. – Juri Sep 28 '16 at 07:27
  • You should be aware that nothing better serves static content than nginx or at least any web server – stamster Sep 28 '16 at 10:22
  • @Juri I'm using Nginx for Production but it would be easier for me if I could use the PHP Built in Server for development – ghovat Sep 28 '16 at 11:54
  • @stamster I'm using Nginx for Production, the route is for image reseizing. For Development it would be easier if I could use the PHP Built in Server – ghovat Sep 28 '16 at 11:55
  • What's a problem with downloading nginx and setting it ? It's like 5 minutes and no problem. – Juri Sep 29 '16 at 06:58

0 Answers0