MyBB Community Forums

Full Version: Restricting access to directories
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi everyone,
I'd like to restrict users from accessing pages I do not want them to explore. I'm not sure how to explain this properly but I'll try. For example suppose there is this userbar image on my website:

http://website.com/images/groupimages/admin.png

Now users can get the above link by simply checking the link of the image. Now he can remove the unwanted part of URL and browse through the current directory and it's parent directories like:

http://website.com/images/groupimages/
http://website.com/images/

[Image: LAE9aVa.png]

How do I prevent users from doing this? I'd like to somehow redirect them automatically to the homepage or display a blank page, an error or something similar. Thank you!
you can just add a blank index.html file in such folders !

index.html file may contain code like below
<html>
<head>
<title></title>
</head>
<body>
&nbsp;
</body>
</html>
(07-06-2016, 07:20 AM).m. Wrote: [ -> ]you can just add a blank index.html file in such folders !

Thank you .m for the fast reply! To be honest, I did not know what exactly to search to find a solution to my problem. I just saw this:

Quote:Another way to add to security to the files is the add to/create a .htaccess file in the forum root containing
Options -Indexes

in this thread: http://community.mybb.com/thread-131553.html

Is this what I'm looking for? Will doing this be easier than adding an index.html page in all the directories? Thank you!
yes, you can also use above given .htaccess directive.

default MyBB system already uses blank index.html files.
your custom folders might be missing the index.html file.
Thanks a lot. I've successfully added the restriction using the .htaccess file. Thanks a lot for the help!