Having used Route::get('/', ContnameController@methodName, how can I make Laravel (5.8 and above) show its default 404 page when myapp/index.php is used in the address bar?
In another word: How can I prevent Laravel from showing a file with .php extension when an alternative Route is used to access the same file?
Apache Mod Rewrite is enabled and there is no problems related to it. Everything related to it works fine and all requests are directed to index.php as expected. I only do not want the user to use myapp/index.phpinstead of what I define in Route::get('/',.... Laravel seems to treat both interchangeably!
This is not a duplicate of Apache Mod rewrite question. Now the default (out of the box) Laravel home page is pulled from welcome.blade.php and is accessed via laravelapp/ as per the default Route::get('/', ... But that same page is also accessible via laravelapp/index.php. Is that an expected and accepted behavior if you do not want extensions in your app URLs? Obviously, if this is undesired behavior, then the Apache Mod rewrite is not the culprit even if there is an .htaccess fix.