php - Restrict laravel to open url that is not in route -


i learning laravel now.

today came across problem surprised me. open link in browser: http://localhost/laravel/project/ch/resources/views/pages/blog.blade.php , expect error 404. opens contains of file.

so, how restrict laravel this.

i want laravel open url mentioned in routes.otherwise error 404.

this because access site http://localhost. every file , folder inside root folder accessible via browser.

so don't run project localhost proper virtual host. example make http://project.dev , use access site

<virtualhost *:80>    documentroot "/laravel/project/public"    servername project.dev </virtualhost> 

that way won't able access resources/views because outside of document root. (one folder higher public folder)

you can upload site webhost , see won't able access files , folders above public folder in browser.


Comments

Popular posts from this blog

twig - Using Twigbridge in a Laravel 5.1 Package -

firemonkey - How do I make a beep sound in Android using Delphi and the API? -

jdbc - Not able to establish database connection in eclipse -