Take the 2-minute tour ×
Web Applications Stack Exchange is a question and answer site for power users of web applications. It's 100% free, no registration required.

I want to block traffic and visitors to my blogger.com blog from a certain country. In this case, those from .ru (Russian domains).

Is it possible to globally block these visitors? Would this be done through a pure JavaScript method?

share|improve this question

1 Answer 1

No, you can't. You need access to the server administration tools (like .htaccess ) to flawlessly block IPs from a certain country.

The closest thing that can be done with JavaScript is to get the browser language preference and redirect browsers with Russian as their preferred language to another URL. However, this would block all people who are not in Russia and use their browsers in Russian (this includes a lot of people in former Soviet republics, and Russian language learners). This would also not block people who are in Russia, but use their browser in other language.

Anyway, blocking an entire country is not something I would suggest you to do, especially if you are only having problems with spam. What about all valid Russian-speaking people with good intentions that would be blocked? If that's the case (spam), I suggest you to instead replace the default Blogger system with the Disqus commenting system. It has many features, including a strong antispam protection that let you set blacklists.

share|improve this answer

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.