1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Need Help Banning Domains Via Htaccess

Discussion in 'Site & Server Administration' started by ebsports, Feb 8, 2016.

  1. #1
    Okay, long story short is I received a message from one of my advertisers saying a couple sites were more or less scraping my content, which lead to a hijacking of an iFrame and they shut down my ads because I didn't meet the audit percentage thanks to the iFrame thinking the bad domains were my domain.

    They've restored them, but asked that I ban the bad domains so they can't keep doing it.

    I'm using Wordpress and after doing some research online, I added this snip of code to my htaccess file:

    RewriteEngine on
    # Options +FollowSymlinks
    RewriteCond %{HTTP_REFERER} aolsearch\.com [NC,OR]
    RewriteCond %{HTTP_REFERER} particlenews\.com [NC,OR]
    RewriteCond %{HTTP_REFERER} renoun\.io [NC,OR]
    RewriteCond %{HTTP_REFERER} top1-seo-service\.com [NC,OR]
    RewriteCond %{HTTP_REFERER} unblocksit\.es [NC]
    RewriteRule .* - [F]



    I just copied and pasted that into the htaccess file. Yet, I noticed that I'm still getting visits from some of those sites.

    Am I missing a step?
     
    ebsports, Feb 8, 2016 IP
  2. Localnode

    Localnode Active Member

    Messages:
    33
    Likes Received:
    7
    Best Answers:
    1
    Trophy Points:
    65
    #2
    Try this:
    
    <IfModule mod_rewrite.c>
    RewriteEngine on
    Options +FollowSymlinks
    RewriteCond %{HTTP_REFERER} ^https?://([^.]+\.)*aolsearch\.com\
    RewriteCond %{HTTP_REFERER} ^https?://([^.]+\.)*particlenews\.com\ [NC,OR]
    RewriteCond %{HTTP_REFERER} ^https?://([^.]+\.)*renoun\.io\ [NC,OR]
    RewriteCond %{HTTP_REFERER} ^https?://([^.]+\.)*top1-seo-service.com\ [NC,OR]
    RewriteCond %{HTTP_REFERER} ^https?://([^.]+\.)*unblocksit\.es\ [NC]
    RewriteRule .* - [F]
    </IfModule>
    Code (markup):
    You can replace https? with "http(s)?" or simply "http://"

    The [NC] code means "No Case", meaning match the url regardless of being in upper or lower case letters.

    OR means "Or Next", as in, match this domain or the next line that follows.
    You had on the that line [NC,OR], where-as on the second to last line you had [NC]. The above code should work.


    Alternatively, if you can check the logs and see the IP addresses of above domains
    
    order allow,deny
    deny from 127.0.0.1
    deny from 127.0.0.2
    deny from 127.0.0.3
    allow from all
    Code (markup):
    Replacing the above IP's respectively.
     
    Last edited: Feb 10, 2016
    Localnode, Feb 10, 2016 IP
  3. UnderHost_MSA

    UnderHost_MSA Notable Member

    Messages:
    1,194
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    200
    #3
    Localnode reply was correct, you could use these rules as well a bit more simplified;

    RewriteEngine on
    RewriteCond %{HTTP_REFERER} ^http(s)?://(www\.)?aolsearch.com.*$ [NC,OR]
    RewriteCond %{HTTP_REFERER} ^http(s)?://(www\.)?particlenews.com.*$ [NC,OR]
    RewriteCond %{HTTP_REFERER} ^http(s)?://(www\.)?renoun.io.*$ [NC,OR]
    RewriteCond %{HTTP_REFERER} ^http(s)?://(www\.)?top1-seo-service.com.*$ [NC,OR]
    RewriteCond %{HTTP_REFERER} ^http(s)?://(www\.)?unblocksit.es.*$ [NC]
    RewriteRule .* - [F,L]
    Code (markup):
     
    UnderHost_MSA, Feb 11, 2016 IP