webzod
account

Serve security.txt from /.well-known/ on Apache

hygiene.security_txt.legacy_location · effort: minutes

Why it matters

RFC 9116 puts the file at /.well-known/security.txt and keeps /security.txt only for older setups. Researchers and tools look in the standard place first.

The fix

  1. Add an Alias in the virtual host of example.com that maps the standard address to the existing file, and make sure the file's directory is readable by Apache.
  2. If the file lives outside the DocumentRoot, Apache also needs permission for that folder. Uncomment the Directory block in the snippet and put the real folder in it.
  3. Reload Apache and open https://example.com/.well-known/security.txt.
/etc/apache2/sites-available/example.com.conf
Alias /.well-known/security.txt /var/www/html/security.txt

# Only if the file is outside the DocumentRoot, allow its folder too:
# <Directory /srv/security>
#     Require all granted
# </Directory>

The examples use example.com. Replace it with your own domain.

Read the documentation (opens in a new tab)

Scan your domain to see whether this applies to you.