Sunday, August 16, 2015

Prevent executing of script files in particular directory through .htaccess

================================================
Write below code in .htaccess files to prevent executing script fies, this code must be placed in images directory
===================================================================
# Block access to .php and .pl files in an images or other dir
<FilesMatch "\.(p(hp|hp3|hp4|hp5|l|html|hp.jpg))$">
 Deny from all
</FilesMatch>

<FilesMatch "\.(ht(m|ml))$">
 Deny from all
</FilesMatch>

<FilesMatch "\.txt$">
 Deny from all
</FilesMatch>

<Files *.zip>
Order Deny,Allow
Deny from all
</Files>

Options -indexes

No comments:

Post a Comment