Lumen route with period

274 views Asked by At

In Laravel I can simply have an route with period like so:

Route::get('/foo.bar', function() {
  return 'Hello';
});

But in Lumen :

$router->get('/foo.bar', function() {
  return 'Hello';
});

This always returns 404 error:

The requested resource /foo.bar was not found on this server.

Please tell me why can't we have routes containing periods?

Any help would be great appreciated.

P.S:

If I replace the period with dash ( - ) or underscore ( _ ) it works fine.

1

There are 1 answers

0
Silvanus Matiku On

Most likely this is a server configuration issue. If using Apache try configuring .htaccess to remove .index.php when serving the page