XF 1.5 How to make a directory in /library folder publicly accessible?

Stockwalker

Active member
I have a folder within /library folder that I want users to be able to access from within the browser.

How can I set the permissions for that?
 

Mike

XenForo developer
Staff member
The short answer is really that you don't/shouldn't. Anything that needs to be publicly accessible should be elsewhere. If it's a PHP script, it should go in the root directory generally.
 

RSI

Active member
I agree with Mike, but if you must you have to edit your .htaccess file within the library folder. Mainly you don't want to give read access to your
config.php file or to your add-on folders there either. You would probably need to create new .htaccess files in each of the add-on folders to stop it there and then add the code to your .htaccess file in your sites main root directory to protect the config.php file.

The below is what stops it in the library folder.
Code:
Order deny,allow
Deny from all
Then add this to your main .htaccess file in you sites main root directory.
Code:
# START CONFIG PROTECTION
<FilesMatch "config.php">
deny from all
</FilesMatch>
# END CONFIG PROTECTION
Again, not a good idea or recommended.
.
 
Last edited:
Top