How can I block my url, e.g. myapp.com/images
on production? By typing this address, the user can check all available images from the server. I can not connect with images while working locally, but I have this problem on production. Thank you for your help
2
Answers
You can disable the file listing by adding the following to your
.htaccess
file (assuming you are running Apache):You can also use middleware to restrict access to this site. This also provide you an option to give access to a certain users (especially with login accounts)
RestrictionsMiddleware.php
then if you want to total restriction then just redirect to any landing page you want.
You just declare it on the controller or function you want to have this restriction. in my case i declare it to the construct of the controller
MyController.php