Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I'm getting a lot of spam referral traffic from semalt.semalt.com/referral on my website. I took a look at the link and there’s very little information about this.

The number of website visits is 185 this month, and they result in a 100% bounce rate.

So how I can block this website?

share|improve this question
    
What web server? Apache? IIS? I can help with .htaccess. –  closetnoc Jul 29 at 5:57
    
web server is Apache –  Vaibhav Pandya Jul 29 at 6:01
    
I get a bunch of these referrals too, but since I study this stuff, I allow it. –  closetnoc Jul 29 at 6:11
    
This should work. I used an older example .htaccess that has a lot of entries in it. Let me know how it goes. –  closetnoc Jul 29 at 6:22

1 Answer 1

This should work...

RewriteCond %{HTTP_REFERER} semalt\.semalt\.com [NC]
RewriteRule .* - [F,L]

...will force a 403 error. Otherwise...

RewriteCond %{HTTP_REFERER} semalt\.semalt\.com [NC]
RewriteRule .* http://www.gosomewhereelse.com [R,L]

... will send them some where else. (just change the domain name please.)

share|improve this answer
    
semalt original url is www.semalt.com and in my google analytics shows in semalt.semalt.com/referral so which url i add –  Vaibhav Pandya Jul 29 at 6:23
    
I have semalt.semalt.com as the referral here. But if you want, you can just use semalt.com. If you are not aware of regular expressions, I intentionally did not use ^ and $ which denote the beginning of the expression and the end. In this case, semalt.com will match semalt.semalt.com just fine. –  closetnoc Jul 29 at 6:49
    
What do you mean by "semalt original url is www.semalt.com"? ... just to be sure that semalt.com is not the domain of your site? Also, since the RewriteCond pattern is a regular expression (as closetnoc suggests), the . (period) should strictly be escaped to match a literal . rather than any character, ie. semalt\.semalt\.com. –  w3d Jul 29 at 8:39
    
@w3d Yes. You are technically correct! I edited the answer to make the change. Regex in .htaccess assumes, or at least used to, that text/domain specification was possible and was rather forgiving, hence my examples are probably more lazy than they should be. I would rather be technically correct and so I appreciate the flag. My examples did work okay when Apache 2.2 was released, but it is far better to CYA of course. Thanks again for the reminder!! –  closetnoc Jul 29 at 15:33

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.