Jump to content


Photo

Need Help With .htaccess File Access And Direct To Single .php Before


  • Please log in to reply
3 replies to this topic

#1 Kalikali

Kalikali
  • Members
  • 2 posts

Posted 19 February 2012 - 09:59 AM

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 :)

#2 TCH-Dick

TCH-Dick

    General Manager

  • Admins
  • PipPipPipPip
  • 5,786 posts

Posted 19 February 2012 - 09:41 PM

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.

Dick DeVance
General Manager
TotalChoice Hosting, Inc
dick@totalchoicehosting.com


Posted Image


#3 Kalikali

Kalikali
  • Members
  • 2 posts

Posted 20 February 2012 - 08:50 AM

Hi sir.

Can u assist on how to do it?

#4 TCH-Dick

TCH-Dick

    General Manager

  • Admins
  • PipPipPipPip
  • 5,786 posts

Posted 23 February 2012 - 01:28 PM

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.

Dick DeVance
General Manager
TotalChoice Hosting, Inc
dick@totalchoicehosting.com


Posted Image





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users