What are you trying to do in test.php, or what's your actual goal with this external script? AFAIK, if something doesn't have a route defined laravel, laravel won't pick it up.
getting a .php URL to hit the laravel code base
Hi all, So currently running an API server in laravel Forge. Issue I am running into right now is URLs like http://domain.com/test.php do not actually hit my laravel code. NGINX is trying to find that file specifically instead of hitting my code. Ideally this would fall into the laravel application and 404 triggering a lookup i do in my DB for redirects. It would then find this domain.com/test.php in the DB and redirect to the value in the DB.
I have been stumbling around for a while with this one. Hiding the .php extension in NGINX is not going to do anything as it might be hidden but it will have the same behaivor.
All i am getting at this point is: "No input file specified. "
In your nginx php location, you need to direct it to a file if it's 404. Since you probably have;
location ~ \.php {
//
}
It will read all .php URLs and try to find the file. If you want to direct all .php requests to Laravel (if the actual file doesn't exist), use something like this, not tested;
location ~ \.php {
try_files $uri /index.php;
}
Please or to participate in this conversation.