• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Resolved Not seeing X-Robots-Tag from .htaccess

SlimDeluxe

New Pleskian
Server operating system version
Ubuntu 20.04
Plesk version and microupdate number
Obsidian 18.0.55
Hi,
I have the following in .htaccess:
Apache config:
<Files ~ "\.pdf$">
  Header set X-Robots-Tag "noindex, nofollow"
</Files>

This works fine in local development. I can see the header.
However, when in production, the header is not there. Please see attached image.

What is the reason behind this and how can I fix this? :)

I checked the Logs and there's no error when accessing a PDF file, so I suppose there's no problem with the .htaccess directive. It's just ignored. Other directives from the same .htaccess work ok.

Any help would be appreciated.
 

Attachments

  • 2023-10-16_10-00.png
    2023-10-16_10-00.png
    58.7 KB · Views: 2
Ah, sorry, I forgot that this is served by nginx.
The solution is to set this custom nginx directive in "Additional nginx directives" under Hosting settings for the domain.
NGINX:
location ~* \.pdf$ {
    add_header X-Robots-Tag "noindex, nofollow";
}
 
Back
Top