HotLink Protection

leblover

Verified User
Joined
Apr 22, 2004
Messages
26
hi all

in cpanel there is somthing name HotLink
it make protion to the images so no one can copy the link and us it out ur site

and when u enable it,

it crate .htaccess with this code in the public_html

Code:
RewriteEngine on 
RewriteCond %{HTTP_REFERER} !^$ 
RewriteCond %{HTTP_REFERER} !^[url]http://leblover.com/.*[/url]$      [NC] 
RewriteCond %{HTTP_REFERER} !^[url]http://leblover.com[/url]$      [NC] 
RewriteCond %{HTTP_REFERER} !^[url]http://www.leblover.com/.*[/url]$      [NC] 
RewriteCond %{HTTP_REFERER} !^[url]http://www.leblover.com[/url]$      [NC] 
RewriteRule .*\.(jpg|jpeg|gif|png|bmp)$ [url]http://www.leblover.com/test.jpg[/url] [R,NC]


so what i did is :

i make this code in cpanel and i copy it to my direct admin site
but nothing happend
no error nothing
and the images stille show in any other site
by the way
RewriteEngine is on and i try anther code need RewriteEngine and it work


so if this code work with direct admin so how i make it work ?

or if it did not work how can i do any other code give me the same protion ?

so i have any help here abut it pls ?
 
Last edited:
It would make a neat feature addition. Especially since competing control panels (example: cpanel) has had this for a long time now.
 
first of all i want to think you for ur help

i try this code as u show me

Code:
RewriteEngine on 
RewriteCond %{HTTP_REFERER} !^$ 
RewriteCond %{HTTP_REFERER} !^[url]http://[/url]([url]www.[/url])?24at24.com.*$ [NC] 
RewriteRule .(gif|jpg)$ - [F]






but as u can see now


if there is www. nothing happed


nav_en.gif




but if we make the code with no www. it work


nav_en.gif







so any more help :$

im so poor for ur help :D
 
I just tried the piece of code on one of mine and it worked like a charm.
Perhaps an apache configuration is set incorrectly?
 
While hotlink protection is activited how can I show a diffrent picture then the one that the other site is trying to get from my machine?
 
Something like this might work (probably needs some debuggin)

Code:
RewriteEngine On
RewriteCond %{HTTP_REFERER} !^[url]http://[/url](www\.)?example\.com/ [NC
RewriteCond %{HTTP_REFERER} !^$
RewriteRule \.(jpe?g|gif|bmp|png)$ images/nohotlink.jpg [L]
where images/nohotlink.jpg is the picture showed instead.
 
Back
Top