Reputation: 319
I am quite new in Laravel PHP framework. I had a project and successfully completed and right now it's in production (online sever). but today I saw that everyone can access the base directory of site by just adding a slash to search string and folder name.
For example, if someone type like this
www.mywebsite.com
the page is working properly and all user access are working.
but when someone type like this
www.mywebsite.com/pages
They can access all my pages stored in the folder. All php files which are secrete and must not be viewed publicly. Actually I am storing some pages in the folder (pages).
This is a screen shot. Displaying files in the directory which is not public.
I know, I am missing a small thing, but I don't know how to get that.
Upvotes: 1
Views: 145
Reputation: 62
Put a 404.blade.php file in your resource/views/errors folder
if it does not work then stop Auto Directory Index from your hosting.
You can try this .htaccess to prevent Auto Index
IndexIgnore *
I hope it will work
Upvotes: 1
Reputation: 6773
where is you index.php file? put index.php inside the public folder. also .htaccess should be there too with appropriate settings.
Upvotes: 0