Route with dots in localhost:8000 doesn't work?

Work with “normal” setup

In my plugin I have some routes. They work perfectly fine on for example http://localhost/kirby/.

Doesn’t work with port 8000

Then I got a report that the routes does not work with http://localhost:8000/kirby/.


In my routes.php I have this:

'pattern' => self::$route . '/assets/js/dist/(:any)',

Matches anything after dist. However with the 8000 setup it does not work with dots in the last part, not even with (:all).



Doesn’t match


It’s not even a Kirby 404. It’s error by PHP. How can this be? How to get around it?

I like to have my dots to show that the routes are files.

To reproduce download the Splitview plugin and setup a local environment on port 8000. It can be done with php -S localhost:8000 in the command line.

Subject taken from this thread:

I think the port is not the issue, I tried on port 80 too and it still didn’t work. PHP’s internal server probably handles paths a bit differently.
It shouldn’t be used in production anyway, and has other limits (like the inability to process PNGs with its embedded GD version) so it’s probably not a critical issue. It’s just convenient for quick tests :slightly_smiling:

1 Like

That’s a bug/“feature” in the PHP dev server. You can read more about this issue in the GitHub issue about the Panel having similar issues (which has now been fixed by replacing the dots with other characters).

1 Like

Then I will solve it the same way, but not today. Thanks!