Jump to content

Recommended Posts

Posted

Dear gurus

 

I have a website of my music band and we share our sample music .mp3 on the site. My question is how do I deny the direct access www.example.com/song.mp3 and whever user access the .mp3 link will redirect them to a single page www.example.com/download.php and force them to read our download term with a check box before proceed download the file.

 

Please help. I been searching high and low for this solution and found none :)

Posted

Personally I would store all the files in a directory with an htaccess using the single line "deny from all". Then I would just give my links out as example.com/download.php?song=some.mp3. Doing so in this manner would completely eliminate the direct access and depending on your download script, possible hide the actual file path.

Posted

You would just create a file named .htaccess in your mp3 dir and add the following line to that file.

>deny from all

 

As for your download script, that is all going to depend on how you choose to code it and what scripting language you choose.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...