.htaccess rules for not executing php in images folder

Add the following code in your .htaccess file in images folder for not to execute PHP in images folder:

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

That’s it!!!

Post navigation

Arunlal Ashok

Engineer at Endurance International Group. Linux lover.

Always happy for an open discussion! Write to arun (@) crybit (dot) com.

One thought on “.htaccess rules for not executing php in images folder

  1. Hi & thanks
    But, how to call only error.php in .htaccess file in images folder for not to execute other PHP in images folder

    Thank you very mush

Leave a Reply

Your email address will not be published. Required fields are marked *