HotLink protections tutorial

Filed in Apache 7 comments

as one of my visitors asked me a tutorial ,guiding aout how to protect his links from leechers and those who have put the refrence of his files in a link in other websites so that his bandwidth would be stole and consume him to pay more for hsi site bandwidth

the following is the guide to accomplish this

open the .htaccess or crete one in the root of your site

then edit it as follow

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://domain.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.domain.com/.*$ [NC]
RewriteRule .*\.(gif|jpg|jpeg|mid|html|bmp|txt|wmv|zip|rar|mp3)$ <a rel="nofollow" href="http://www.domain.com/">http://www.domain.com</a> [R,NC]</code>

If the desk splits any of the above into two lines, please note that each line starts with Rewrite, so if any line gets split into multiple lines by the desk, you would need to ensure that it is corrected by putting the contents back to the original line. The total is 5 lines long for the code.

The domain.com and “http://www.domain.com” entries would need to be replaced by the user’s domain name. this should work to limit any files (images, zip, rar and so on) from being directly linked by another site.

No related posts.

Posted by voshka   @   31 January 2010 7 comments

Share This Post

RSS Digg Twitter StumbleUpon Delicious Technorati

7 Comments

Comments
Feb 4, 2010
11:44 am
#1 Sam :

Thank woshka :)

Author Feb 4, 2010
12:14 pm
#2 admin :

You’re Welcome ;)
if you wanted further assistance do not hesitate to ask me again

Feb 23, 2010
11:35 pm

Enter the extensions to protect from hotlinking, separated by a space. Referer Spoofing

Mar 7, 2010
7:29 am

There are a number of problems associated with hotlinking. Cpa Fake Referrer

Mar 9, 2010
11:28 am
#5 SirJ :

hi woshka
have a nice time
My website have many of pages , and some of pages have many address!! :(
for example this page :
index.php?name=link
links.html
from htaccess i call link.html for index.php?name=link ! (sorry for my bad english :D )
now , why i lock link.html for adsress.
I searched in google & found one command:
[QSA,L,R=301]
but not working fine.because when i type [QSA,L,R=301] in htaccess only run index.php?name=link and link.html redirect to 404 page :(
thanks …
i’m waiting for you look sometimes :) .
Sam_Pontiac :)
ghalat hasho khodet begir :D

Author Mar 9, 2010
12:41 pm
#6 voshka :

I would be so much greateful if you could be able to provide me a link of your website to investigate to see which portal or content management system you are using or it is handmade
if it is hand made you must provide some rull in .htaccess to use the aliases of your links that could be extracted from which id they are contain

thank you

Apr 12, 2010
12:27 am

Also can be a personal page for a person, which contains information about him or her. Fake Browser Referrer

Leave a Comment

Previous Post
«
Next Post
»
CrossBlock designed by DeltaManual.Com  |  In conjunction with Web Hosting   |   Web Hosting   |   Reverse phone