I have a directory which is 777 permissions because otherways I can't upload images to it via the php web browser form. Our script that does the uploading checks for script files (actually it explicitly allows certain files that way we dont miss some on the block side). I'd like to stop scripts from executing from the directory. I tried setting the permissions to 776 but then the images that need to display on the site dont show up. I tried creating an htaccess file:
<Files ~ "\.(php|php3|php4|phps|phtml|shtm|shtml|cgi|pl|pm|asp|cfm|js|jse|jsp|jar|py|exe|com|bat|dll|pif|scr|reg|inf)$">
deny from all
and it didn't work... so I tried...
AddType text/plain .php
AddType text/plain .php3
AddType text/plain .php5
AddType text/plain .cgi
AddType text/plain .net
AddType text/plain .asp
and still nothing... Thoughts? We have a bunch of sites using this script and structure so I'm looking for a solution which I can just upload a new htaccess or change the chmod or something. I dont want to have to update a wack load of my scripts.