首页 > 解决方案 > html2pdf : 防止谷歌机器人抓取

问题描述

我使用以下脚本:

https://www.html2pdf.fr/en/home

该脚本将我的 php 文件转换为 pdf 文件。

例如 url:mywebsite.com/pdf/url.php?id=8 将生成一个 PDF 文件。另一个例子:https ://github.com/spipu/html2pdf/blob/master/examples/example01.php

我不希望谷歌机器人索引这些页面。

我在我的 htaccess 文件中添加了以下代码,但它不会阻止谷歌抓取页面,因为它是在 PHP 中:#Block indexing of Word and PDF files <files ~ ".(doc|docx|pdf)$"> Header Set X-Robots-Tag "noindex, nofollow

我无法阻止它,我该怎么做?

标签: phphtml-to-pdf

解决方案


推荐阅读