How do I do to stop user/client to navigate in some of my website folders using URL like this:
www.site.com/main_folder/subfolder_Contaienr/files.php
www.site.com/main_folder/data/files.php
www.site.com/main_folder/data/also_here_text_files.txt
With this URL, the user can navigate to my folders and I do not want that he navigate to my website folders.
Also everyday I have some new folders. I use files in folder for external scope (e.g in some folder there are images and need to show users. In some folders are text files in which is JSON data or some users details.)
Is there any way to stop navigate to my folders using php Code without touching .htacess
file?