WEB hook me up with a .htaccess that only allows OT referrers

Discussion in 'OT Technology' started by biawokauns, Apr 20, 2009.

  1. biawokauns

    biawokauns New Member

    Joined:
    Sep 18, 2001
    Messages:
    19,893
    Likes Received:
    0
    Location:
    Republic of Kalifornia
    some fuckers are sharing porn with non-OTers, i need to stop this stat
     
  2. Browning

    Browning Active Member

    Joined:
    Feb 14, 2005
    Messages:
    89,463
    Likes Received:
    10
  3. maxxpower

    maxxpower OG Lauren Crew - Observer OT Supporter

    Joined:
    May 27, 2007
    Messages:
    26,348
    Likes Received:
    0
    paging jesse
    he had it down pretty good
     
  4. biawokauns

    biawokauns New Member

    Joined:
    Sep 18, 2001
    Messages:
    19,893
    Likes Received:
    0
    Location:
    Republic of Kalifornia
    i think i got meat spun by him a few times :o
     
  5. PocoDiablo

    PocoDiablo New Member

    Joined:
    Jul 11, 2004
    Messages:
    4,413
    Likes Received:
    0
    Location:
    NOVA
    Try this:

    Code:
    ErrorDocument 404 http://www.[B]YOURSITE[/B].com/mt/404.php
    
    RewriteEngine on  
    RewriteCond %{HTTP_REFERER} !^$  
    RewriteCond %{HTTP_REFERER} !^http://(www.)?offtopic.com(/)?.*$ [NC]
    RewriteRule \.(htm|php)$ http://www.[B]YOURSITE[/B].com/403.php [R,L]
    
    Notice the ".(htm|php)$" part - put in any extensions you want to protect. I am just protecting htm and php files on my site. You'll probably want to add jpg|gif|jpeg etc.

    Also notice the last line - that's where they go or what they see if they try to link to my site. You can make it a page or an image (such as "Don't steal my badwidth" thing, or lemon party, etc.)
     
  6. biawokauns

    biawokauns New Member

    Joined:
    Sep 18, 2001
    Messages:
    19,893
    Likes Received:
    0
    Location:
    Republic of Kalifornia
    thanks, ill peep this later
     
  7. Ricky

    Ricky █▄ █▄█ █▄ ▀█▄

    Joined:
    Jun 17, 2005
    Messages:
    38,766
    Likes Received:
    6
    i use something like this

    Code:
     <?php
    $referer_c = "1";
    $referer = array("offtopic.com","forums.offtopic.com");
    $fail = "http://www.google.com/fail";
    
    if($referer_c=="1") {
    if(!isset($_REQUEST['grant'])) { 
    
    while(list($key,$val)=each($referer)) {
    if(strstr($_SERVER['HTTP_REFERER'],$val)) {
    $grant = 'true';
    
    
    if($grant!='true') {
    header("Location: $fail");
    exit;
    }
    }
    ?>
    
     
  8. Jesse

    Jesse PSN: iamajesse; XBL: Inhale My Rod; G8 GT crew; Ne OT Supporter

    Joined:
    Jan 12, 2005
    Messages:
    25,649
    Likes Received:
    0
    Location:
    California :: (925)
    The method I used didn't work for everyone, but was done with javascript. My htaccess method didn't seem to always be working, but I got the code from Thomor.

    Searching...
     
  9. Jesse

    Jesse PSN: iamajesse; XBL: Inhale My Rod; G8 GT crew; Ne OT Supporter

    Joined:
    Jan 12, 2005
    Messages:
    25,649
    Likes Received:
    0
    Location:
    California :: (925)
    Code:
    Options -Indexes
    RewriteEngine On
    RewriteCond %{HTTP_REFERER} ^(.+\.)?bluefame.com/ [OR]
    RewriteCond %{HTTP_REFERER} ^(.+\.)?naluriseksual.thumblogger.com/ [OR]
    RewriteCond %{HTTP_REFERER} ^(.+\.)?peoplesboard.com/ [OR]
    RewriteCond %{HTTP_REFERER} ^(.+\.)?ft24.net/ [OR]
    RewriteCond %{HTTP_REFERER} ^(.+\.)?fatsa.gr/ [OR]
    RewriteCond %{HTTP_REFERER} ^(.+\.)?bootytorrents.com/ [OR]
    RewriteCond %{HTTP_REFERER} ^(.+\.)?headbangerzxxx.com/ [OR]
    RewriteCond %{HTTP_REFERER} ^(.+\.)?headbangerzxxx.com/forum/ [OR]
    RewriteCond %{HTTP_REFERER} ^(.+\.)?chubbyparade.com/ [OR]
    RewriteCond %{HTTP_REFERER} ^(.+\.)?bootylounge.org/ [OR]
    RewriteCond %{HTTP_REFERER} ^(.+\.)?thickbbwforum.com/ [OR]
    RewriteCond %{HTTP_REFERER} ^(.+\.)?fileporn.org/ [OR]
    RewriteCond %{HTTP_REFERER} ^(.+\.)?puretna.com/ [OR]
    RewriteCond %{HTTP_REFERER} ^(.+\.)?ragam.info/ [OR]
    RewriteCond %{HTTP_REFERER} ^(.+\.)?naluriseksual.thumblogger.com/ [OR]
    RewriteCond %{HTTP_REFERER} ^(.+\.)?bgol.us/ [OR]
    RewriteCond %{HTTP_REFERER} ^(.+\.)?nuthinbutbutts2.blogspot.com/ [OR]
    RewriteCond %{HTTP_REFERER} ^(.+\.)?sfbayvideos.com/ [OR]
    RewriteCond %{HTTP_REFERER} ^(.+\.)?iconshotspot.blogspot.com/ [OR]
    RewriteCond %{HTTP_REFERER} ^(.+\.)?barfland.com/ [OR]
    RewriteCond %{HTTP_REFERER} ^(.+\.)?sogullyworld.com/ [OR]
    #RewriteCond %{HTTP_REFERER} ^(.+\.)?pornbb.org/ [OR]
    RewriteCond %{HTTP_REFERER} ^(.+\.)?realestniggas.com/ [OR]
    RewriteCond %{HTTP_REFERER} ^(.+\.)?chroniccentral.net/ [OR]
    RewriteCond %{HTTP_REFERER} ^(.+\.)?usercash.com/ [OR]
    RewriteCond %{HTTP_REFERER} ^(.+\.)?brawl-hall.com/ [OR]
    RewriteCond %{HTTP_REFERER} ^(.+\.)?terbiyesizalem.com/ [OR]
    RewriteCond %{HTTP_REFERER} ^(.+\.)?shareimages.us/ [OR]
    RewriteCond %{HTTP_REFERER} ^(.+\.)?iconshotspot.blogspot.com/ [OR]
    RewriteCond %{HTTP_REFERER} ^(.+\.)?maktoob.com/ [OR]
    RewriteCond %{HTTP_REFERER} ^(.+\.)?7ek2.com/ [OR]
    RewriteCond %{HTTP_REFERER} ^(.+\.)?anonym.to/ [OR]
    RewriteCond %{HTTP_REFERER} ^(.+\.)?kaskus.us/ [NC]
    RewriteCond %{REQUEST_URI} !^/disabled\.gif$
    RewriteRule \.(gif|jpg|png)$ /disabled.gif [NC,L]
    
    this is for images.. it will replace images with disabled.gif. Would probably work the same with your videos.

    It should replace images with this if you upload it to your root -
    [​IMG]
     
  10. Jesse

    Jesse PSN: iamajesse; XBL: Inhale My Rod; G8 GT crew; Ne OT Supporter

    Joined:
    Jan 12, 2005
    Messages:
    25,649
    Likes Received:
    0
    Location:
    California :: (925)
    Then I had this one that would give some people problems if their browser wasn't carrying over the referer.

    Code:
    <script language="JavaScript" type="text/javascript">
    <!--
    var domain = "http://forums.offtopic.com/showthread.php";
    var domainAlias = "http://jb.uplode.us/index.php";
    var domainAlias2 = "http://forums.offtopic.com/newreply.php";
    var domainAlias3 = "http://forums.offtopic.com/newthread.php";
    var domainAlias4 = "http://pornoh.org/";
    var domainAlias5 = "http://jb.uplode.us";
    var error = 'http://uplode.us'; // Page unwanted referrers are redirected to
    
    if (document.referrer.indexOf(domain) == -1 && document.referrer.indexOf(domainAlias) == -1 && document.referrer.indexOf(domainAlias2) == -1 && document.referrer.indexOf(domainAlias3) == -1 && document.referrer.indexOf(domainAlias4) == -1 && document.referrer.indexOf(domainAlias5) == -1)
    {
    //alert("Please navigate to this page from an OT thread.");
    location.replace(error);
    }
    //-->
    </script>
     
  11. biawokauns

    biawokauns New Member

    Joined:
    Sep 18, 2001
    Messages:
    19,893
    Likes Received:
    0
    Location:
    Republic of Kalifornia
    thanks jesse, im just blocking non-oters form downloading the RARs that are getting hosted. if it doesnt work, fuck em. it's free to them anyways
     
  12. biawokauns

    biawokauns New Member

    Joined:
    Sep 18, 2001
    Messages:
    19,893
    Likes Received:
    0
    Location:
    Republic of Kalifornia
    hmm, this doesn't seem to work

    Code:
    Options -Indexes
    RewriteEngine On
    RewriteCond %{HTTP_REFERER} ^(.+\.)?offtopic.com/ [OR]
    RewriteCond %{HTTP_REFERER} ^(.+\.)?forums.offtopic.com/ [OR]
    RewriteCond %{REQUEST_URI} !^/disabled\.gif$
    RewriteRule \.(rar|zip)$ /disabled.gif [NC,L]
     
  13. Jesse

    Jesse PSN: iamajesse; XBL: Inhale My Rod; G8 GT crew; Ne OT Supporter

    Joined:
    Jan 12, 2005
    Messages:
    25,649
    Likes Received:
    0
    Location:
    California :: (925)
    Change the last [OR] to [NC]
     
  14. biawokauns

    biawokauns New Member

    Joined:
    Sep 18, 2001
    Messages:
    19,893
    Likes Received:
    0
    Location:
    Republic of Kalifornia
    wtf is OR
     
  15. Jesse

    Jesse PSN: iamajesse; XBL: Inhale My Rod; G8 GT crew; Ne OT Supporter

    Joined:
    Jan 12, 2005
    Messages:
    25,649
    Likes Received:
    0
    Location:
    California :: (925)
    Oh shit, sorry... this is the wrong script. That is to ban JUST those domains.

    You should be able to google to find what you need. It was harder to find what I wanted since it was the opposite of what's common.

    And what I meant was this:

    RewriteCond %{HTTP_REFERER} ^(.+\.)?offtopic.com/ [OR]
    RewriteCond %{HTTP_REFERER} ^(.+\.)?forums.offtopic.com/ [OR]

    change the bolded "[OR]" to "[NC]" since it's the last on the list of bans.
     
  16. biawokauns

    biawokauns New Member

    Joined:
    Sep 18, 2001
    Messages:
    19,893
    Likes Received:
    0
    Location:
    Republic of Kalifornia
    :bowrofl:
     
  17. Jesse

    Jesse PSN: iamajesse; XBL: Inhale My Rod; G8 GT crew; Ne OT Supporter

    Joined:
    Jan 12, 2005
    Messages:
    25,649
    Likes Received:
    0
    Location:
    California :: (925)
    Google something like "htaccess whitelist"
     
  18. Finest

    Finest OG #93

    Joined:
    Mar 16, 2000
    Messages:
    30,770
    Likes Received:
    42
    Location:
    Wisconsin. Seriously.
    Porn first, .htaccess afterwards. :x:
     
  19. biawokauns

    biawokauns New Member

    Joined:
    Sep 18, 2001
    Messages:
    19,893
    Likes Received:
    0
    Location:
    Republic of Kalifornia
    Code:
    RewriteEngine On
    RewriteCond %{HTTP_REFERER} !^http://(.+\.)?offtopic\.com/ [NC]
    RewriteRule .*\.(rar|zip)$ /disabled.gif [L]
    
    here's what i'm using
     
  20. biawokauns

    biawokauns New Member

    Joined:
    Sep 18, 2001
    Messages:
    19,893
    Likes Received:
    0
    Location:
    Republic of Kalifornia
  21. Jesse

    Jesse PSN: iamajesse; XBL: Inhale My Rod; G8 GT crew; Ne OT Supporter

    Joined:
    Jan 12, 2005
    Messages:
    25,649
    Likes Received:
    0
    Location:
    California :: (925)
  22. Tony Stark

    Tony Stark John McCain has an illegitimate mexican baby

    Joined:
    Jun 27, 2003
    Messages:
    40,060
    Likes Received:
    0
    should just have all the non-OTers download a rar file containing nothing but 2girls1cup
     

Share This Page