首页 > 解决方案 > 使用 .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]

谢谢您的帮助 !

标签: .htaccesspinterest

解决方案


推荐阅读