How To Stop Others Stealing your Website Contents

Discussion in 'Programming' started by smithy2000, Apr 9, 2010.

  1. #1
    Hi all,

    I would like to share this small code with DP users.

    Today I have noticed some idiots using iframe to use my website on their domain..so after quick search I have found this nice code which you can use to block anyone from linking to your website contents illegally, you can block all sort of files jpg, html, php, flash, videos, mp3 and so on. Trust me I have use it and it works, and on the stealer's end they will see Forbidden 500 error... ;)

    RewriteEngine On
    RewriteCond %{HTTP_REFERER} website1.com [OR,NC]
    RewriteCond %{HTTP_REFERER} website2.net [OR,NC]
    RewriteCond %{HTTP_REFERER} website3.co.cc [NC]
    RewriteRule .*.(gif|jpg|swf|png|html|php|asp|xml|htm)$ - [NC,F]

    just copy and paste the above code in your .htaccess file on your server, if you do not have one just copy and paste in txt file using notepad and rename it exactly like this .htaccess oh:rolleyes: do not forget to replace the website1, website2 and website3 with the website(s) you wish to block, you can add more website lines to block, also you can add/remove different file extension to block....once done upload to your server and see the error on their side:cool:

    I hope this helps
    here is the original source where I found this code:
    http://support.modwest.com/content/...they-steal-images-flash-etc-from-my-site.html

    Stop contents theft
     
    smithy2000, Apr 9, 2010 IP
  2. nimonogi

    nimonogi Active Member

    Messages:
    398
    Likes Received:
    3
    Best Answers:
    1
    Trophy Points:
    80
    #2
    To prevent all websites from hotlinking, you can use this code:
    
    RewriteEngine on
    RewriteCond %{HTTP_REFERER} !^$
    RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?yourdomain.com [NC]
    RewriteRule \.(jpg|jpeg|png|gif)$ - [NC,F,L]
    
    Code (markup):
    Change yourdomain.com with your domain name.

    This will redirect visitors to your homepage.
     
    nimonogi, Apr 10, 2010 IP
  3. TGForums

    TGForums Peon

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    A+ to this. I was looking for something like this a long time ago with a problem I was having and this was actually the solution I used. I'm glad to see someone sharing it =)
     
    TGForums, Apr 13, 2010 IP
  4. vannarith

    vannarith Active Member

    Messages:
    1,814
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    50
    #4
    Thanks for your nice sharing. i am finding this method before but cant get it just now. thz :)
     
    vannarith, Apr 14, 2010 IP
  5. NeoCambell

    NeoCambell Peon

    Messages:
    456
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Nice indeed.
     
    NeoCambell, Apr 14, 2010 IP
  6. nimonogi

    nimonogi Active Member

    Messages:
    398
    Likes Received:
    3
    Best Answers:
    1
    Trophy Points:
    80
    #6
    I am glad I was able to help :)
     
    nimonogi, Apr 14, 2010 IP
  7. Shiv bhaker

    Shiv bhaker Greenhorn

    Messages:
    14
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #7
    thanx a lot for sharing such a imp. information,
     
    Shiv bhaker, Apr 15, 2010 IP
  8. blacksheep666

    blacksheep666 Active Member

    Messages:
    68
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    93
    #8
    still not safe. there are other ways to steal web contents not just using iframes like for example php curl, http_client, file_get_contents etc.
     
    blacksheep666, Apr 21, 2010 IP
  9. smithy2000

    smithy2000 Peon

    Messages:
    132
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Okay, you should then in light us with some ideas instead of pointing out the wholes without providing the solution for them..
     
    smithy2000, Apr 21, 2010 IP
  10. Conama

    Conama Guest

    Messages:
    25
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #10
    Thanks for the share. I think I've heard about it before but my websites don't need to be protected anyway. :p
     
    Conama, Apr 24, 2010 IP
  11. Brad33

    Brad33 Peon

    Messages:
    69
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #11
    This is probably the most effective method against hotlinking, just a lfew htaccess rules.

    But, this will not protect your content from being saved and re-uploaded anywhere (Which is basically impossible, if it can be seen or heard it can be copied).
     
    Brad33, Apr 24, 2010 IP