[Method] Protect your site from negative SEO redirects

Scripteen

Elite Member
Joined
Sep 19, 2009
Messages
1,818
Reaction score
1,930
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 and +rep given. Probably one of the most useful things on BHW recently.
 
Very usefull information...that negative seo can ruin allot of ppl around here. thanx allot
 
With that code installed What would happen to Adwords traffic and redirected domains that point to your own website?
 
Yeah, it should work. Have you tested it ?


D.
 
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.
 
this will come in handy when i get back to mns and start doing authority site..
 
Good to know, will have my IT guy give this a good look.
 
Thanks, very useful. Thanks and rep given. How can you tell if there are any 301 redirects to your site?
 
With these google updates I have to think about adding this code to my htaccess files
10x for that info
 
looks cool but this will redirect everything including short urls etc?
 
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.

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]
 
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]


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.
 
Might want to add conditionals for legitimate use of URL shortening services as dichotomy noted. Although those can be abused as well.
 
Don't do any kind of general, broad-covering redirect, always name the domains, otherwise you could be killing off precious backlinks!!

Si
 
Back
Top