阻止特定国家/地区的Github页面

时间:2015-01-04 04:56:57

标签: .htaccess google-analytics hosting github-pages web-traffic

我最近使用github静态页面托管了我的网站。我对网络相关的东西很新。我发现使用.htaccess文件,我们可以使用SetEnvIf CF-IPCountry RU BuzzOff=1阻止某些国家。

但github页面不支持.htaccess。有一种重定向网页的解决方法。

当我google阻止访问某些国家/地区的github页面时,我得到的是哪些国家/地区已阻止github以及github做了什么来撤消阻止。

是否有一种简单的方法可以阻止某个国家/地区的网站?它不是关于隐私。但我有来自某个国家/地区的不必要的大量访客,因此非常讨厌使用Google Analytics。

1 个答案:

答案 0 :(得分:0)

There is a Javascript solution found at https://github.com/MohamedBassem/spam-referrals-blocker.

From the GitHub repo:

The idea simply is that this repo will use this community-contributed list to create a JS file which will block the spam referral for you. The library will then be updated with the new urls but with the same download url. By having the script automatically included in your website you won't have to update the spam referral list in your google analytics anymore, it will be automatically done for you.

Works with Google Analytics and GitHub / Jekyll.