Support » Everything else WordPress » How do I keep search engines from searching a pdf?

Viewing 1 replies (of 1 total)
  • You can do this with .htaccess

    # BEGIN file lock-downs
    RewriteCond %{HTTP_COOKIE} !wordpress_logged_in
    RewriteRule ^name-of-the-file\.pdf$ http://example.com/not-allowed/ [R=302,L]
    # END file lock-downs

    Where example.com/not-allowed is a page on your site that you send anyone to when they try to access it. Yes, it will work for robots, unless you allow robots to register and log into your site.

Viewing 1 replies (of 1 total)
  • The topic ‘How do I keep search engines from searching a pdf?’ is closed to new replies.