title: X-Robots-Tag not shown in HTTP response header
body: <p>My sample PDF URL is:
  <a href="https://askanydifference.com/wp-content/uploads/2022/09/Difference-Between-Import-and-Export.pdf" rel="nofollow noreferrer">https://askanydifference.com/wp-content/uploads/2022/09/Difference-Between-Import-and-Export.pdf</a></p>
  <p>I am trying to noindex all my PDF files in my wordpress website. While doing research, I learnt that they can only be marked noindex using .htaccess and not any other means as pdf files don't have any html code for meta tag.</p>
  <p>So by following the solution given below, I added the X-Robots-Tag is my .htaccess file as:</p>
  <p><a href="https://webmasters.stackexchange.com/questions/14520/how-to-prevent-a-pdf-file-from-being-indexed-by-search-engines">https://webmasters.stackexchange.com/questions/14520/how-to-prevent-a-pdf-file-from-being-indexed-by-search-engines</a></p>
  <pre><code>&lt;Files &quot;\.pdf$&quot;&gt;
    Header set X-Robots-Tag &quot;noindex, nofollow&quot;
  &lt;/Files&gt;
  
  
  # BEGIN WordPress
  # The directives (lines) between &quot;BEGIN WordPress&quot; and &quot;END WordPress&quot; are
  # dynamically generated, and should only be modified via WordPress filters.
  # Any changes to the directives between these markers will be overwritten.
  &lt;IfModule mod_rewrite.c&gt;
  RewriteEngine On
  RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
  RewriteBase /
  RewriteRule ^index\.php$ - [L]
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule . /index.php [L]
  &lt;/IfModule&gt;
  
  # END WordPress
  
  &lt;IfModule mod_headers.c&gt;
  Header set Content-Security-Policy &quot;block-all-mixed-content&quot;
  &lt;/IfModule&gt;
  </code></pre>
  <p>I have placed the .htaccess file in public_html folder.</p>
  <p>But when I inspect the file in Firefox under Network tab, the X-Robots-Tag is not present.</p>
  <p>All my caching is disabled</p>
  <p><a href="https://i.stack.imgur.com/jlcxA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jlcxA.png" alt="enter image description here" /></a></p>
  <p>Any help on where I am going wrong</p>