webzod
account

Serve security.txt as text/plain with utf-8 on Apache

hygiene.security_txt.wrong_content_type · effort: minutes

Why it matters

RFC 9116 requires the file to be sent as text/plain in utf-8. Tools may reject it if the server labels it as html, binary or another charset.

The fix

  1. Force the type and charset for the file in the virtual host (or in an .htaccess file inside .well-known, which needs AllowOverride FileInfo).
  2. Reload Apache and check the Content-Type header again.
/etc/apache2/sites-available/example.com.conf
<Files "security.txt">
    ForceType text/plain
    AddDefaultCharset utf-8
</Files>

Read the documentation (opens in a new tab)

Scan your domain to see whether this applies to you.