Welcome Guest, Not a member yet? Register   Sign In
Remove PDFs From Google Search
#1

Hello,

I would be very grateful if someone can advise me on how to correctly apply the 'noindex' to all PDF files within my CodeIgniter web site.
I have read that this can normally be achieved by use of the 'Filesmatch' tag within the .htaccess file as illustrated below, but I am not sure if the code snippet is in the correct format for CodeIgniter.
Many thanks in advance.

Code:
<FilesMatch "\.pdf$">
header set x-robots-tag: noindex
</FilesMatch>

Can I simply enter the above code within the root .htaccess file or do I need to apply a different method?
Many thanks in advance.


 

<
Reply
#2

(10-27-2022, 06:02 AM)Mark H Wrote: Hello,

I would be very grateful if someone can advise me on how to correctly apply the 'noindex' to all PDF files within my CodeIgniter web site.
I have read that this can normally be achieved by use of the 'Filesmatch' tag within the .htaccess file as illustrated below, but I am not sure if the code snippet is in the correct format for CodeIgniter.
Many thanks in advance.

Code:
<FilesMatch "\.pdf$">
header set x-robots-tag: noindex
</FilesMatch>

Can I simply enter the above code within the root .htaccess file or do I need to apply a different method?
Many thanks in advance.

See: https://webmasters.stackexchange.com/a/49124

PHP Code:
<Files "\.pdf$">
  Header set X-Robots-Tag "noindex, nofollow"
</Files
Reply
#3

Thank you so much for your kind response. I will utilise that code within the CodeIgniter .htaccess file and let you know if it resolves my issue.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB