Zen Cart Logo
Forums / General Questions / Adding file extensions to .htaccess in download folder

Adding file extensions to .htaccess in download folder

Locked

Views: 3,007

Results 1 to 1 of 1
This thread is locked. New replies are disabled.
28 Jan 2009, 8:11 PM
#1
ingoito avatar

ingoito

New Zenner

Join Date:
Jan 2009
Posts:
18
Plugin Contributions:
0

Adding file extensions to .htaccess in download folder

Hi,

I want to offer .mp3 and .zip files as downloads. I´m using zencart 1.3.8a on a linux server (GoDaddy shared hosting)

I went through many posts about download security and in one of the tutorials "How do I secure my Downloads folder to prevent theft?" it says about the .htaccess file in the download folder "You could (should) update that file to add the file-extensions for all the types of files in your downloads folder.".

Well, I searched the forum and googled a lot and in the end I had two code suggestions:

  1. to add this code for each file that should be protected:

<Files *.mp3>
Order Deny,Allow
Deny from all
</Files>

<Files *.zip>
Order Deny,Allow
Deny from all
</Files>

  1. to use this code for a combination of file types:

<FilesMatch ".(zip|mp3)$">
Order Allow,Deny
Deny from all
</FilesMatch>

Any recommendations which version works better?

Will it be okay to add this code after the default code in the .htaccess file or is a certain order relevant?

Many thanks in advance