Home Joomla Tip: Securing images, cache and media folder
formats

Tip: Securing images, cache and media folder

Preventing listing directory contents and executing scripts from directories such as images, media, cache, you can place an .htaccess file in them. The .htaccess file in each of those directories should contain the following code:

Updated to version 1.1

Code:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
##########
# This is a .htaccess file for the Joomla images, media and cache directories
# For updates please visit http://locutusweb.asw15.org
# VERSION 1.1
#
# DISCLAIMER: We are not responsible for data loss and/or damage to your website what so ever
# @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
##########
 
########## Begin - Don't list directory contents
IndexIgnore *
Options All -Indexes
########## End - Don't list directory contents
 
########## Begin - Secure directory by disabling script execution
AddHandler cgi-script .php .php2 .php3 .php4 .php5 .php6 .php7 .php8 .pl .py .jsp .asp .htm .html .shtml .sh .cgi
Options -ExecCGI
########## End - Secure directory by disabling script execution
 
########## Begin - Deny direct access to .htaccess
# Uncomment following lines if don't have them in your webroots .htaccess
#<Files .htaccess>
#order allow,deny
#deny from all
#</Files>
########## End - Deny direct access to .htaccess
##########
# This is a .htaccess file for the Joomla images, media and cache directories
# For updates please visit http://locutusweb.asw15.org
# VERSION 1.1
#
# DISCLAIMER: We are not responsible for data loss and/or damage to your website what so ever
# @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
##########

########## Begin - Don't list directory contents
IndexIgnore *
Options All -Indexes
########## End - Don't list directory contents

########## Begin - Secure directory by disabling script execution
AddHandler cgi-script .php .php2 .php3 .php4 .php5 .php6 .php7 .php8 .pl .py .jsp .asp .htm .html .shtml .sh .cgi
Options -ExecCGI
########## End - Secure directory by disabling script execution

########## Begin - Deny direct access to .htaccess
# Uncomment following lines if don't have them in your webroots .htaccess
#<Files .htaccess>
#order allow,deny
#deny from all
#</Files>
########## End - Deny direct access to .htaccess
 
 Share on Facebook Share on Twitter Share on Reddit Share on LinkedIn
No Comments  comments 
© Locutus-Web Services
credit