Developer System Administrator Jahia 7.3 Jahia 8 Legacy

Add http header to requests


How to add http header in http response when a user download a file


This can be done with a rewrite rule. For example, the following rule would add the header X-Robots-Tag to any url matching pdf

        <name>Set header for pdf files</name>
        <note>rule to set noindex</note>
        <set type="response-header" name="X-Robots-Tag">noindex</set>

The rule can be customized to work with files of other types, or files from a specific site or path.