Page 1 of 1

[SOLVED] .htaccess for uploads

Posted: Wed Jun 18, 2008 11:50 am
by Ziggywigged
I've tried using the method here... http://wiki.cmsmadesimple.org/index.php/How_to#How_to_Secure_CMSMS_system_-_Small_Guide
...to protect my uploads directory but it 'disables' anything in this directory when I implement. i.e. the browser won't load anything in/from my sub-directories.

My structure looks like this:

/uploads
  .htaccess
  /images
  /video

My htaccess file contains:

Code: Select all

<Files *.php>
    Order deny,allow
    Deny from All
</Files>
The site is running on an Apache server with PHP 5.2.5
Am I missing something?

Thanks.

Re: .htaccess for uploads

Posted: Wed Jun 18, 2008 12:41 pm
by kermit
try this.

http://svn.cmsmadesimple.org/svn/cmsmad ... /.htaccess

which currently contains:

Code: Select all

# To deny PHPs
<Files ~ "\.(php|php3|php4|php5|phtml|pl|cgi)$">                                                                              
  order deny,allow                                                                                                            
  deny from all                                                                                                               
</Files> 
originally discussed in this thread..

http://forum.cmsmadesimple.org/index.ph ... #msg111094

Re: .htaccess for uploads

Posted: Wed Jun 18, 2008 1:34 pm
by Ziggywigged
Ah ha, that does work. Thank you.

Is this related to PHP/Apache version?
Should this guide be revised?
http://wiki.cmsmadesimple.org/index.php/How_to#How_to_Secure_CMSMS_system_-_Small_Guide

Re: [SOLVED] .htaccess for uploads

Posted: Wed Jun 18, 2008 1:52 pm
by kermit
afaik, the htaccess files for the various subdirectories of an install will be added in the next release, so yeah, there'll be some updates in the wiki needed.

Re: [SOLVED] .htaccess for uploads

Posted: Wed Jun 18, 2008 6:16 pm
by Pierre M.
kermit wrote: ...htaccess files for the various subdirectories of an install will be added in the next release...
Good news !

Pierre M.