• Introducing WebPros Cloud - a fully managed infrastructure platform purpose-built to simplify the deployment of WebPros products !  WebPros Cloud enables you to easily deliver WebPros solutions — without the complexity of managing the infrastructure.
    Join the pilot program today!
  • Support for BIND DNS has been removed from Plesk for Windows due to security and maintenance risks.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS.

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: 4
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