Skip to the content
Documentation
Help Start
Reading in:
  • German: 9,199 of 9,199 pages
About the help in other languages
All help pages

Add a security.txt file

Step by step - publish /.well-known/security.txt (RFC 9116) for your site, which Exponential does not ship, add the one rewrite rule the shipped Apache rules need to serve it, and check it with curl.

Download as PDF

Address: https://doc.exponential.earth/exphelp/viewer/help/government/tasks/compliance/add-security-txt.md

On this page

Add a security.txt file

For administrators and hosting teams. A security.txt tells researchers where to report vulnerabilities in your site. The project's statement lists it as not shipped (Adding security.txt).

Warning

.htaccess slows down every request. When .htaccess files are enabled (AllowOverride anything but None), let alone used, Apache looks for them and reads and evaluates them on every request, in every directory of the path, and page loading times go up drastically (measured). The only real fix is to switch the feature off for the virtual host: AllowOverride None in the HTTPS virtual host, and the rules in the virtual host's own configuration as mod_rewrite rules. That is far faster in production speed tests and well worth the time it takes to optimize a production configuration. Switch over right away: copy the rules of the example HTTPS virtual host into your virtual host (with the static cache, also staticcache_offload.conf), set AllowOverride None, run apachectl configtest, reload Apache and test the site. The same rules for other servers: nginx, LiteSpeed, Caddy, IIS, Velocity (built in); where virtual host rules go in a control panel: Plesk, cPanel, DirectAdmin, ISPConfig. On LiteSpeed or OpenLiteSpeed, the server's own page cache can also answer anonymous visitors and crawlers without PHP: Page caching with LiteSpeed and OpenLiteSpeed.

Note This page describes features and common practice; it is not legal advice. Check the law that applies to your organization with your legal counsel.

Contents

  1. Before you start
  2. Steps
  3. Check that it worked
  4. Related pages

Before you start

  • A security contact mailbox and, ideally, a published disclosure policy page (see "Vulnerability disclosure").
  • Access to the document root and the web server configuration.

Steps

  1. Create .well-known/security.txt in the document root:

    Contact: mailto:[email protected]
    Expires: 2027-10-31T23:00:00.000Z
    Policy: https://www.example.gov/vulnerability-disclosure
    Preferred-Languages: en
    Canonical: https://www.example.gov/.well-known/security.txt

    Contact and Expires are required by RFC 9116 (https://www.rfc-editor.org/rfc/rfc9116); keep Expires less than a year ahead.

  2. Apache with .htaccess_root: dot paths except .well-known answer 404, and the last rule sends everything else to index.php. Add, before RewriteRule .* index.php:

    RewriteRule ^\.well-known/security\.txt$ - [L]
  3. nginx: make sure a location serves the file before requests fall through to index.php.

  4. Add the file (and the rule) to your deployment so the next release keeps them.

Check that it worked

curl -sI https://www.example.gov/.well-known/security.txt | head -3
curl -s https://www.example.gov/.well-known/security.txt

Status 200, a plain text type, your file. An HTML page means the request reached index.php. Put the Expires date in your calendar.

Become an Exponential Partner

Partners share their information, provide funding, contribute back and develop the products with us, and that is how Exponential grows. A partner website and dashboard are planned for mid-2027: please become a partner today to speed up our growth rate and land new features faster.

Something wrong on this page? Report an error

Documentation license

This documentation is free documentation, licensed under the GNU Free Documentation License 1.3 or later.

Exponential Copyright © 1998-2026 Exponential Foundation and 7x