1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

[Method] Protect your site from negative SEO redirects

Discussion in 'Black Hat SEO' started by Scripteen, Jun 14, 2012.

  1. Scripteen

    Scripteen Elite Member

    Joined:
    Sep 19, 2009
    Messages:
    1,811
    Likes Received:
    1,918
    Home Page:
    I had an incident where someone was redirecting few banned domains to my website (talk negative seo) so I made a short list of these bad domains and blocked them from pointing to my server but the guy added few more domains so I needed a more practical solution and after research and try and error I came up with the following code that you should put in your .htaccess file.


    Code:
    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^mydomain.com
    RewriteRule (.*) http://www.mydomain.com/$1 [R=301,L]
    
    
    RewriteEngine on
    RewriteCond %{HTTP_HOST} !=www.mydomain.com
    RewriteRule .* http://www.google.com [R=301,L]
    
    The first part of the code redirects non www to www then the 2nd one filters any traffic coming from any domain other than yours to google.com or you can change google.com to any other domain you want and send garbage traffic to it. This gives some kind of protection layer to one of the methods used by negative SEO.
     
    • Thanks Thanks x 19
  2. vulzala

    vulzala Junior Member

    Joined:
    Apr 23, 2011
    Messages:
    175
    Likes Received:
    105
    Location:
    Southern Spain
    Thanks and +rep given. Probably one of the most useful things on BHW recently.
     
  3. garrido

    garrido Supreme Member

    Joined:
    Nov 28, 2011
    Messages:
    1,301
    Likes Received:
    341
    Occupation:
    Hacker / Developer
    Location:
    Hackerland
    You rock man!
     
  4. OnLust

    OnLust Registered Member

    Joined:
    Jul 5, 2011
    Messages:
    50
    Likes Received:
    3
    Location:
    Portugal
    Very usefull information...that negative seo can ruin allot of ppl around here. thanx allot
     
  5. blackberry

    blackberry Power Member

    Joined:
    Apr 26, 2009
    Messages:
    675
    Likes Received:
    218
    Occupation:
    Making money
    Location:
    Planet Earth
    With that code installed What would happen to Adwords traffic and redirected domains that point to your own website?
     
  6. NLhead38

    NLhead38 Jr. VIP Jr. VIP Premium Member

    Joined:
    Jan 10, 2010
    Messages:
    547
    Likes Received:
    383
    Location:
    Western Europe
  7. dbyrn

    dbyrn Power Member

    Joined:
    Feb 20, 2010
    Messages:
    746
    Likes Received:
    224
    Occupation:
    helping people
    Yeah, it should work. Have you tested it ?


    D.
     
  8. cemedia

    cemedia Registered Member

    Joined:
    Feb 22, 2012
    Messages:
    87
    Likes Received:
    6
    thanks for this info.
     
  9. seoguy81

    seoguy81 Power Member

    Joined:
    May 18, 2011
    Messages:
    779
    Likes Received:
    163
    Occupation:
    Full time IM
    Location:
    My Desk
    Great share. Is there a way to 'Whitelist' some domains? I'm sure some, if not most of us here have some domains that are being re-directed. Would be great if someone could find a solution to re-direct 'acceptable' sites and the rest redirect to google.com or whatever.
     
  10. walandio

    walandio Senior Member

    Joined:
    Jun 27, 2008
    Messages:
    1,198
    Likes Received:
    684
    Location:
    Pilipinas
    this will come in handy when i get back to mns and start doing authority site..
     
  11. ThopHayt

    ThopHayt Jr. VIP Jr. VIP Premium Member

    Joined:
    Jul 25, 2011
    Messages:
    5,396
    Likes Received:
    1,644
    Good to know, will have my IT guy give this a good look.
     
  12. JuppiDu

    JuppiDu Newbie

    Joined:
    May 27, 2012
    Messages:
    2
    Likes Received:
    0
    Great! Many thx.
     
  13. rugbyjack2005

    rugbyjack2005 Power Member

    Joined:
    Oct 2, 2011
    Messages:
    539
    Likes Received:
    50
    Location:
    United Kingdom
    Thanks, very useful. Thanks and rep given. How can you tell if there are any 301 redirects to your site?
     
  14. kuzmanin

    kuzmanin Regular Member

    Joined:
    Jul 17, 2010
    Messages:
    386
    Likes Received:
    45
    With these google updates I have to think about adding this code to my htaccess files
    10x for that info
     
  15. dichotomy

    dichotomy Regular Member

    Joined:
    Apr 17, 2011
    Messages:
    274
    Likes Received:
    52
    looks cool but this will redirect everything including short urls etc?
     
  16. Stizerg

    Stizerg Power Member

    Joined:
    Oct 23, 2011
    Messages:
    611
    Likes Received:
    167
    The second part says "If host name is not mydomain.com, then redirect everything to google.com"
    There's nothing to do with incoming traffic. It is absolutely useless.

    If you want to redirect incoming traffic from bad sites, use this code in your .htaccess :

    Code:
    RewriteCond %{HTTP_REFERER} badsite1\.com [NC,OR] 
    RewriteCond %{HTTP_REFERER} badsite2\.com
    RewriteRule .* http://www.google.com [R=301,L]
     
  17. Scripteen

    Scripteen Elite Member

    Joined:
    Sep 19, 2009
    Messages:
    1,811
    Likes Received:
    1,918
    Home Page:

    301 redirect is a host not a referrer. Your code is useless in such case. The code in the first post is the real deal.
     
  18. wpbacklinks

    wpbacklinks Jr. VIP Jr. VIP Premium Member

    Joined:
    Mar 27, 2010
    Messages:
    3,397
    Likes Received:
    1,339
    Gender:
    Male
    Occupation:
    Affiliate Marketer
    Location:
    Everywhere
    This is a very short useful guide.. awesome.
     
  19. assphuck

    assphuck Senior Member

    Joined:
    Feb 22, 2009
    Messages:
    1,196
    Likes Received:
    905
    Might want to add conditionals for legitimate use of URL shortening services as dichotomy noted. Although those can be abused as well.
     
  20. simey69

    simey69 Regular Member

    Joined:
    Mar 27, 2009
    Messages:
    325
    Likes Received:
    1,478
    Location:
    UK
    Don't do any kind of general, broad-covering redirect, always name the domains, otherwise you could be killing off precious backlinks!!

    Si