1

In my laravel application I wants to allow routes with .php extensions like:

xyz.com/some/random/url.php

If I just add it as a normal route then I get error No input file specified.

It works fine with php artisan serve but not with production nginx server. I think I've to change something at nginx config or .htaccess file but not sure.

Does anyone has any idea or hint how I can do this?

Ramesh Mhetre
  • 404
  • 2
  • 12
  • URIs ending with `.php` are usually handled by a specific `location` block in a typical Nginx configuration. You current configuration is guilty of [sending uncontrolled requests to PHP](https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/#passing-uncontrolled-requests-to-php). Both issues can probably be fixed with the addition of a `try_files` statement. For specific help, please edit your question and add your Nginx configuration file containing the relevant `server { ... }` block. – Richard Smith Nov 21 '18 at 09:34
  • If anyone is still interested in finding solution to the question above, use this link and choose the very first answer: https://stackoverflow.com/questions/22287649/add-url-extensions-to-laravel-routes – cd4success Aug 02 '23 at 01:33

0 Answers0