Jump to content
Sign in to follow this  
Kalikali

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

Share this post


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.

Share this post


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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×