Forum Moderators: phranque

Message Too Old, No Replies

Hotlink Protection subdomain + folder

         

Angie

2:54 am on Jun 19, 2010 (gmt 0)

10+ Year Member



All right. I'm as new to this as I can get. I've read as much as I could, trying to understand as much as possible, but I'm... obviously kinda retardo about this.

I've been looking into hotlink protection. The code
RewriteCond %{HTTP_REFERER} !^http://([^.]+\.)+domain\.com [NC]


works for subdomains.domain.com but when I try to access domain.com/folder, I get my hotlink protection. Is there any code for allowing subdomain.domain.com AND domain.com/folder that I've missed? I've looked through as my threads as I could before giving up and posting.

jdMorgan

3:50 am on Jun 19, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



That's a pure regular-expressions question. (There's a nice tutorial cited in our Forum Charter, BTW)

You're looking for:
 RewriteCond %{HTTP_REFERER} !^http://([^.]+\.[b])*d[/b]omain\.com [NC] 

-or-
 RewriteCond %{HTTP_REFERER} !^http://([^.]+\.[b])?d[/b]omain\.com [NC] 


Jim

Angie

4:08 am on Jun 19, 2010 (gmt 0)

10+ Year Member



I love you forever. I must have missed it. I'll look for that tutorial and give it a deeper read, so my newbie questions aren't so newbie. Thank you!