Forum Moderators: phranque

Message Too Old, No Replies

hotlink disabled only for some websites

         

vaggos

7:14 pm on Jul 10, 2008 (gmt 0)

10+ Year Member



Hello,

I am trying to find as soon as possible a way to disable hotlinking for specific websites not every website but mine.

I find a lot of examples that just block everything.

I need to block only domains and subdomains like #*$!.com and forum.#*$!.com and some domains like #*$!.ltd.xx

If you can point me to an example how to do this I would appreciate it a lot

Thanks

wilderness

8:38 pm on Jul 10, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Make sure you read the thread completely and not just grabbing the first lines you see:

[webmasterworld.com...]

vaggos

12:19 pm on Jul 12, 2008 (gmt 0)

10+ Year Member



RewriteEngine On
RewriteCond %{HTTP_REFERER} ^http://(www\.)?#*$!\.com/ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http://(#*$!\.)?yyy\.net/ [NC]
RewriteRule \.(jpe?g¦gif¦png)$ - [F]

I have found this as an example but I want some help.

If I want to ban a domain like #*$!.co.uk, it will be like

RewriteCond %{HTTP_REFERER} ^http://(www\.)?domain\.com\.uk/ [NC,OR] ?

Also with the above example I specify the www.domain.com, forum.domain.com how I can wildcard everything like *.domain.com ?

One last thing if the referer is an IP address how I will add it to the above example?

Thank you very much

vaggos

12:21 pm on Jul 12, 2008 (gmt 0)

10+ Year Member



About the 2nd like for some reason it was tranlsated to #*$! instead of x x x .com

jdMorgan

3:04 pm on Jul 12, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



> If I want to ban a domain like abc.co.uk, it will be like

RewriteCond %{HTTP_REFERER} ^http://abc\.domain\.com\.uk [NC,OR] ?

> Also with the above example I specify the www.domain.com, forum.domain.com how I can wildcard everything like *.domain.com ?

RewriteCond %{HTTP_REFERER} ^http://([^.]+\.)*domain\.com [NC,OR]

> One last thing if the referer is an IP address how I will add it to the above example?

RewriteCond %{HTTP_REFERER} ^http://192\.168\.10\.101 [OR]

Avoid a common problem: Take care to see that your last RewriteCond *does not* have an [OR] flag on it.

See the documents cited in our Forum Charter, and the tutorials in the Apache Forum Library (links to top of this page) for more info.

Jim

vaggos

5:37 pm on Jul 12, 2008 (gmt 0)

10+ Year Member



Thank you! Great help.