html2pdf icon indicating copy to clipboard operation
html2pdf copied to clipboard

prevent the crawl of the google robot

Open rvantoine opened this issue 4 years ago • 2 comments

Hi,

how to prevent the google robot from indexing PHP pages that generate PDF? I added the code below in my htaccess file but it doesn't prevent google from crawling the page because it's in PHP.

#Block indexing of Word and PDF files <files ~ ".(doc|docx|pdf)$"> Header Set X-Robots-Tag "noindex, nofollow </Files>

rvantoine avatar Mar 08 '21 11:03 rvantoine

Hello,

this is not linked with html2pdf, but with apache configuration

Regards,

romain-neil avatar Mar 24 '21 21:03 romain-neil

You can try adding X-Robots-Tag HTTP Response header in the script that generates your PDF file. Source

uiartist avatar Mar 11 '22 05:03 uiartist