.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 A

Senior System Developer at Zeta. Linux lover. Traveller. Let's connect! Whether you're a seasoned DevOps pro or just starting your journey, I'm always eager to engage with like-minded individuals. Follow my blog for regular updates, connect on social media, and let's embark on this DevOps adventure together! Happy coding and deploying!

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 *