.htaccess - 使用 .htaccess 将特定页面阻止到 Pinterest
问题描述
我在使用 Pinterest 时遇到了问题:我网站页面的 pin 已将我自己的页面从 Google 结果中推开。
我想阻止来自 Pinterest 的此特定页面的任何抓取或新 pin
Pinterest 用户代理是:
Pinterest/0.2 (+https://www.pinterest.com/bot.html)
Mozilla/5.0 (compatible ; Pinterestbot/1.0 ; +https://www.pinterest.com/bot.html)
Mozilla/5.0 (Linux ; Android 6.0.1 ; Nexus 5X Build/MMB29P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.96 Mobile Safari/537.36 (compatible; Pinterestbot/1.0; +https://www.pinterest.com/bot.html)
Pinterest Bot IP 范围是:
54.236.1.XXX.
例如,我要阻止的页面在其 URL 中包含“子字符串”
这是我在 .htaccess 中的代码,显然它不起作用:
RewriteEngine On
RewriteCond %{REQUEST_URI} substring [NC]
RewriteCond %{HTTP_USER_AGENT} pinterest [NC,OR]
RewriteCond %{HTTP_REFERER} ^(www\.)?pinterest\. [NC,OR]
RewriteCond %{REMOTE_ADDR} ^54\.236\.1\.
RewriteRule .* - [F]
谢谢您的帮助 !
解决方案
推荐阅读
- python - 根据不同的列列表从 DataFrame 中选择行的有效方法
- python - Pandas:使用具有相同固定重复次数的数据框填充固定数量的新列
- python - 在 Go 中采购 `/etc/environment`
- iframe - iframe 将原点发送为空
- prolog - 定义规则时的分号
- r - R (Studio) 导入 xlsx/csv 并按列设置 NA/missing
- pandas - pandas 以 5 分钟为基础创建组 ID
- javascript - Regex.exec 仅显示第一次出现
- sql - 将 XML 文档插入 SQL 表
- javascript - 如何检测两个数组之间的对象差异?