I have sub directory 'images' with permission 777 to upload images from visitors in this folder there is .htaccess file to prevent script execution and more security
<Files ^(*.jpeg|*.jpg|*.JPEG|*.JPG|*.png|*.gif)>
order deny,allow
deny from all
</Files>
<FilesMatch "\.(php|pl|py|jsp|asp|htm|shtml|sh|cgi)$">
ForceType text/plain
</FilesMatch>
But when i request images/page.php in browser, it is working which is meaning .htaccess does not working. I want to prevent this folder from executable file.
Is there any mistake in my .htaccess file
One more comment here, I would advise to case insensitive check for your scripts rule, that would be:
<FilesMatch "(?i)\.(php5|php4|php|php3|php2|phtml|pl|py|jsp|asp|htm|shtml|sh|cgi)$">
ForceType text/plain
</FilesMatch>
This works fine for our server.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With