durangod
Coder
Hi, so awhile back i got this from phpbb as it blocks access to certain folders. My question is do i have to create an htaccess in every folder OR list every folder in this code? I have a ton of folders and listing each one is madness. Originally i just started creating index.php files in each folder and leaving it blank but that too is alot of work and there has to be a better way. I dont want the public to be looking at my dir listings in my folders. I seem to remember something from php about this but its been a long time.
FYI i do already have this code in my root htaccess file
here is the code i got from phpbb
Thanks Dave 🙂
FYI i do already have this code in my root htaccess file
Code:
Options -Indexes
Options +FollowSymLinks
DirectoryIndex index.php
here is the code i got from phpbb
Code:
# With Apache 2.4 the "Order, Deny" syntax has been deprecated and moved from
# module mod_authz_host to a new module called mod_access_compat (which may be
# disabled) and a new "Require" syntax has been introduced to mod_authz_host.
# We could just conditionally provide both versions, but unfortunately Apache
# does not explicitly tell us its version if the module mod_version is not
# available. In this case, we check for the availability of module
# mod_authz_core (which should be on 2.4 or higher only) as a best guess.
<IfModule mod_version.c>
<IfVersion < 2.4>
<Files "config.php">
Order Allow,Deny
Deny from All
</Files>
<Files "common.php">
Order Allow,Deny
Deny from All
</Files>
</IfVersion>
<IfVersion >= 2.4>
<Files "config.php">
Require all denied
</Files>
<Files "common.php">
Require all denied
</Files>
</IfVersion>
</IfModule>
<IfModule !mod_version.c>
<IfModule !mod_authz_core.c>
<Files "config.php">
Order Allow,Deny
Deny from All
</Files>
<Files "common.php">
Order Allow,Deny
Deny from All
</Files>
</IfModule>
<IfModule mod_authz_core.c>
<Files "config.php">
Require all denied
</Files>
<Files "common.php">
Require all denied
</Files>
</IfModule>
</IfModule>
Thanks Dave 🙂
Last edited: