How to Prevent PHP, Perl Executable scripts Run in your Image Folder with .htaccess file

Sometimes  you donot need to run php code in all your folder such as your image folder. In your Image folder, add following codes:

order allow,deny
 deny from all

# secure directory by disabling script execution
 AddHandler cgi-script .php .pl .py .jsp .asp .htm .shtml .sh .cgi
 Options -ExecCGI

Above codes will deny all .php, .pl, .py, .jsp, .asp, .htm, .shtml, .sh,.cgi to run in your image folder.

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.