使用.htaccess阻止PhantomJS bot

使用.htaccess阻止PhantomJS bot,.htaccess,phantomjs,.htaccess,Phantomjs,我想阻止来自某个看起来像是机器人或其他恶意流量的流量(我还没有完全弄清楚它是什么,但我想我不想要它)。到目前为止,我一直通过IP阻止它,但是流量一直来自不同的位置 这种流量的共同点是用户代理是PhantomJS,它们都显示以下本地地址(可能有一些变化): file:///home/poo_master/price_parse/resource_cache/140578757867264tmp2.html 是否可以使用.htaccess阻止PhantomJS或任何包含“poo_master/pri

我想阻止来自某个看起来像是机器人或其他恶意流量的流量(我还没有完全弄清楚它是什么,但我想我不想要它)。到目前为止,我一直通过IP阻止它,但是流量一直来自不同的位置

这种流量的共同点是用户代理是PhantomJS,它们都显示以下本地地址(可能有一些变化):

file:///home/poo_master/price_parse/resource_cache/140578757867264tmp2.html


是否可以使用.htaccess阻止PhantomJS或任何包含“poo_master/price_parse/resource_cache/”的内容

通过用户代理或请求的URL阻止机器人程序/刮板程序将这些重写规则添加到.htaccess:

RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} ^.*(PhantomJS|wget|HTTrack|python).*$ [OR]
RewriteCond %{REQUEST_URI} ^.*poo_master/price_parse.*$ 
RewriteRule . - [F,L]

用以下代码更新.htaccess文件。希望它能起作用

RewriteEngine on
RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{HTTP_USER_AGENT} ^.*(PhantomJS|wget|HTTrack|python).*$ [OR]
RewriteCond %{REQUEST_URI} ^.*poo_master/price_parse.*$ 
RewriteRule ^(.*)$ index.php/$1 [L,QSA]

你知道这是什么原因吗?我有同样的。没有。。我猜这是某种像TradeDoubler/Kelkoo等人的价格分析。。我知道他们做了一些检查,但当我问他们的客户服务时,他们告诉我他们并没有造成这种流量。但谁知道客户支持人员知道什么。。