Forum Moderators: phranque

Message Too Old, No Replies

redirect .mp3 links, yet allow podcast feed

         

ekitel

8:02 pm on May 10, 2005 (gmt 0)

10+ Year Member



I'm having problems with people linking directly to my .mp3 files

I have used the following lines in .htaccess to redirect people to my site index page

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?example.com/.*$ [NC]
RewriteRule \.(mp3)$ [example.com...] [R,L]

this works great, the only problem is that I also have a podcast, rss2 feed, and I want people who are subscribed to the feed to be able to download the mp3's, but the above code effectively prevents that also, so I was wondering if there is some way to change that code to allow downloads by podcast clients, yet redirect anybody who clicks a link on a website

thanks in advance!

[edited by: jdMorgan at 9:12 pm (utc) on May 10, 2005]
[edit reason] Removed specifics per TOS. [/edit]

ekitel

9:16 pm on May 10, 2005 (gmt 0)

10+ Year Member



ok I found a fix, this works for iPodderX, I'll add more lines for other clients, and maybe some podcast sites as well, feel free to comment if there's something that could be better

RewriteEngine on
RewriteCond %{HTTP_REFERER}!^$
RewriteCond %{HTTP_USER_AGENT}!^iPodder [NC]
RewriteCond %{HTTP_REFERER}!^http://(www\.)?radiomotion.com/.*$ [NC]
RewriteRule \.(mp3)$ [radiomotion.com...] [R,L]