Jump to content

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

Recommended Posts

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

Link to post
Share on other sites

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.

Link to post
Share on other sites

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.

Link to post
Share on other sites

Join the conversation

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

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