Trying to avoid audio file breach with .htaccess, but no luck. Help?

84 views
Skip to first unread message

ikazuchi

unread,
Sep 8, 2012, 6:44:30 AM9/8/12
to jpl...@googlegroups.com
I've searched around and couldn't find a viable solution to hide the filepath of the audio file when 'Viewing Source.'  I came across this .htaccess method in a forum elsewhere:

#RewriteRule .*\.(mp3)$ - [F,NC,L]

It pretty much takes any URL that end with .mp3 and throws a forbidden page.  While this works great if people want to copy the filepath into the browser or use software like Download Accelerator Plus, it also disables jPlayer from loading the audio file.  Am I even inching toward the right direction? I'd like to use jPlayer's flash player, but I've read about browser compatibility issues.

Sean Miller

unread,
Sep 8, 2012, 7:24:31 AM9/8/12
to jpl...@googlegroups.com
Does the filepath actually have to be in the public_html/httpdocs area (ie. accessible from a browser)??

I thought you could put it somewhere else, as it's php that is serving the file to jPlayer.

But I may be wrong.

Sean

ikazuchi

unread,
Sep 8, 2012, 6:45:13 PM9/8/12
to jpl...@googlegroups.com
I haven't thought of that.  I'll give it a shot and well see if that works.

ikazuchi

unread,
Sep 9, 2012, 2:44:14 PM9/9/12
to jpl...@googlegroups.com
Sean, thanks for your reply it lead me to find the following usage:

inside .htaccess 

<files "*.mp3">
deny from all
</files>

jPlayer was still able to pull the songs but now throws a forbidden page when trying to access the file directly!

On Saturday, September 8, 2012 4:24:38 AM UTC-7, Sean Miller wrote:

ikazuchi

unread,
Sep 21, 2012, 4:27:09 AM9/21/12
to jpl...@googlegroups.com
meh, turned out this didn't work.  Turned out Chrome kept the file in cache so initially I thought it worked.  After clearing cache this deny from all denied jPlayer from pulling the file too. bummer.
Reply all
Reply to author
Forward
0 new messages