I don't want the user to see the sub directory structures. So I am thinking of redirecting the user to the homepage whenever they try to access that.
Asked
Active
Viewed 126 times
1
-
You can prevent users from accessing empty directories in web server configuration. – cakan Dec 02 '15 at 12:49
-
1Yes you can do this. But the problem is when ever you create a directory you need to put index.php. Better approach would be using `htaccess` to prevent directory listing. http://stackoverflow.com/questions/1229127/preventing-directory-listing-by-redirecting – Tintu C Raju Dec 02 '15 at 12:49
-
1htaccess definitely is an alternative, but you may want to read this: https://www.nginx.com/resources/wiki/start/topics/examples/likeapache-htaccess/ (in short, using htaccess isn't free either) – fvu Dec 02 '15 at 13:38
1 Answers
3
you can just put .htaccess file with Options -Indexes
in it in root directory.

Community
- 1
- 1

Alex Babak
- 489
- 3
- 15