How to block Digital Ocean Inc. Google Analytics Direct Traffic using .htaccess

我的梦境 提交于 2019-12-24 09:13:10

问题


Explanation: I have gone through my Google Analytics and noticed I am receiving direct traffic from Digital Ocean Inc. multiple times a day (around 24) as new visits 100% bounce rate and 0 second page duration. Further research shows that its just a cloud service but I also found a list of blacklisted IP's here and multiple other people reporting the same traffic.

Question: Since I have this range of IP's that may or may not be my problem would I be able to block these IP's from accessing my site using my .htaccess file? Is there a better method other than just filtering out the traffic using a Google analytics filter?

IP's Listed by website for Digital Ocean Inc: 198.211.96.0 - 198.211.127.255


回答1:


I noticed the same issue on my recent launch... How I plan on fixing it is blocking the ISP Provider instead of IP address.

also im adding to my .htaccess

  #get rid of the bad bot
   RewriteEngine on
   RewriteCond %{HTTP_USER_AGENT} ^DigitalOceanInc.
   RewriteRule ^(.*)$ http://go.away/



来源:https://stackoverflow.com/questions/27955965/how-to-block-digital-ocean-inc-google-analytics-direct-traffic-using-htaccess

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!