[SOLVED] .htaccess for uploads

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
Ziggywigged
Power Poster
Power Poster
Posts: 424
Joined: Sat Feb 02, 2008 12:42 am

[SOLVED] .htaccess for uploads

Post 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.
Last edited by Ziggywigged on Wed Jun 18, 2008 1:34 pm, edited 1 time in total.
Take a penny, leave a penny.
User avatar
kermit
Power Poster
Power Poster
Posts: 693
Joined: Thu Jan 26, 2006 11:46 am

Re: .htaccess for uploads

Post 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
eternity (n); 1. infinite time, 2. a seemingly long or endless time, 3. the length of time it takes a frozen pizza to cook when you're starving.
4,930,000,000 (n); 1. a very large number, 2. the approximate world population in 1986 when Microsoft Corp issued its IPO. 3. Microsoft's net profit (USD) for the quarter (3 months) ending 31 March 2007.
CMSMS migration and setup services | Hosting with CMSMS installed and ready to go | PM me for Info
Ziggywigged
Power Poster
Power Poster
Posts: 424
Joined: Sat Feb 02, 2008 12:42 am

Re: .htaccess for uploads

Post 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
Take a penny, leave a penny.
User avatar
kermit
Power Poster
Power Poster
Posts: 693
Joined: Thu Jan 26, 2006 11:46 am

Re: [SOLVED] .htaccess for uploads

Post 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.
eternity (n); 1. infinite time, 2. a seemingly long or endless time, 3. the length of time it takes a frozen pizza to cook when you're starving.
4,930,000,000 (n); 1. a very large number, 2. the approximate world population in 1986 when Microsoft Corp issued its IPO. 3. Microsoft's net profit (USD) for the quarter (3 months) ending 31 March 2007.
CMSMS migration and setup services | Hosting with CMSMS installed and ready to go | PM me for Info
Pierre M.

Re: [SOLVED] .htaccess for uploads

Post 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.
Post Reply

Return to “CMSMS Core”