Setting up security.txt on your platform
Writing the file takes minutes. Getting it served correctly at /.well-known/security.txt is where most setups fail: it has to return status 200, as text/plain with UTF-8, with no CMS, bot protection or build tool getting in the way. This page shows how to do it on the most common platforms and what usually goes wrong.
Overview: which route on which platform
The table lists the shortest route for each platform; the sections below go into detail. For the full walkthrough including signing and maintenance, see the guide. This page focuses on serving the file.
| Platform | Route | Effort | Most common pitfall |
|---|---|---|---|
| WordPress | Upload the file to /.well-known/ via SFTP, or use a plugin | low | Theme error page returned with status 200 |
| Apache | Place the file, set the type in .htaccess | low | A rule that blocks every dot path |
| nginx | Exact-match location with charset utf-8 | low | deny rule for hidden paths |
| IIS and Azure | web.config inside .well-known | medium | Missing charset, .asc returns 404 |
| Cloudflare | Built-in security.txt or a Worker | low | Bot Fight Mode blocks scanners |
| TYPO3 | File in public/.well-known/ or a static route | low | Old, customised .htaccess |
| Shopify | No file access under /.well-known/ | high | Only solvable via another domain |
| GitHub Pages, Netlify, Next.js | File in the output directory | low | Build drops dot folders |
| Webflow, Framer, Wix | Provider feature, where available | varies | Not every builder has one |
What every platform has to deliver
Whatever runs your website, all that counts is what a client gets back when it requests the file. RFC 9116 sets four requirements (section 3):
- Location. The file lives at
/.well-known/security.txt. The old location/security.txtis allowed for legacy compatibility only, either as a copy or as a redirect to the new location. If both exist, the one under/.well-known/wins. - HTTPS. The file is only retrieved over
https://. - Content type. The server responds with
Content-Type: text/plain; charset=utf-8. Many servers omit the charset, and checkers flag that as an error. - Scope. The file applies only to the exact host it was retrieved from, not to subdomains or the parent domain (section 3.1).
If you follow BSI TR-03183-3, the German technical guideline for receiving vulnerability reports, two more points apply: the URI in the Canonical field must be reachable without redirects (4.2.2 c), and firewall and DDoS rules must let services such as internet.nl fetch the file automatically (4.2.11). For signed files there is a practical rule on top: the platform has to serve the file byte for byte as you uploaded it. A CMS that adds blank lines or an editor that converts the encoding breaks the signature.
WordPress
WordPress offers two routes. A real file is the more robust one, a plugin the more convenient.
Route 1: a real file via SFTP or file manager
- Connect via SFTP or your host's file manager to the web root, the folder that contains
wp-config.php,wp-adminandwp-content. - Create a folder named
.well-knownif it does not exist yet. It often does, because Let's Encrypt uses it for certificates. Many tools hide folders starting with a dot, so turn on "show hidden files". - Upload
security.txtin binary mode so that line endings and encoding stay untouched.
The default WordPress .htaccess only hands requests to WordPress when no real file exists. A file under /.well-known/ is therefore served by the web server before WordPress ever sees the request. Add the charset with the rule from the Apache section, placed above the # BEGIN WordPress block. If your WordPress runs on nginx, see nginx.
Route 2: a plugin
The WordPress plugin directory lists, among others, Security.txt Manager (around 700 active installations as of October 2026). It does not create a file; it registers rewrite rules for /.well-known/security.txt and /security.txt and serves the content from the database. Its own description names two limits: if the web server handles those paths before WordPress, you need server-level rules as well, and on a subdirectory multisite only the main site gets the file. A plugin is the way to go when your host does not give you file access.
For a signed file, run gpg --verify after saving it in the plugin to make sure the signature still holds. Whether a plugin outputs the text unchanged depends on how it is written.
Common WordPress mistakes
- Status 200 with HTML. When the file is missing, some themes return their 404 page with status 200, and a checker finds a "file" full of HTML.
curl -sIshows it straight away astext/html. - Page cache. A caching plugin or your host's cache may keep serving an old version or an earlier error page. Purge the cache after every change.
- Blocked dot paths. Some hosting security rules block every path starting with a dot, which results in a 403. Ask your host to allow
/.well-known/.
Apache
On Apache, the file in the .well-known folder of the web root is usually all you need. Apache maps .txt to text/plain but does not always add the charset. These rules in the root .htaccess set it, serve key files with the right type and redirect the legacy location:
<Files "security.txt">
ForceType "text/plain; charset=utf-8"
</Files>
<FilesMatch "\.asc$">
ForceType application/pgp-keys
</FilesMatch>
# Redirect the legacy location
RedirectMatch 301 ^/security\.txt$ https://www.example.com/.well-known/security.txt
RedirectMatch with ^ and $ matches exactly this one path. The simpler Redirect works on prefixes and would also catch paths such as /security.txt.old.
One file for many virtual hosts
If one server hosts many domains, keep a single central copy and map it into every virtual host in the server configuration. You then maintain and sign one file, and every host serves it directly, without a redirect:
Alias "/.well-known/security.txt" "/srv/security/security.txt"
<Directory "/srv/security">
Require all granted
<Files "security.txt">
ForceType "text/plain; charset=utf-8"
</Files>
</Directory>
For the file to apply to each of these hosts, it needs one Canonical line per host. See Multiple domains and subdomains.
When Apache returns 403
The usual cause is a hardening rule that blocks all hidden files and folders, such as RedirectMatch 404 /\. or a RewriteRule on dot paths. Such rules need an exception for /.well-known/. The .htaccess template shipped with TYPO3 is a good model that does exactly this (see TYPO3).
nginx
nginx serves files in dot folders by default, but many configuration templates include a hardening rule such as location ~ /\. { deny all; } that also catches /.well-known/. In nginx an exact-match location with an equals sign takes precedence over every regular expression, so you can open up security.txt without weakening the rule:
location = /.well-known/security.txt {
alias /etc/nginx/security/security.txt;
default_type text/plain;
charset utf-8;
}
location = /security.txt {
return 301 https://$host/.well-known/security.txt;
}
charset utf-8 appends the charset to the content type. It only applies to the types listed in charset_types, and text/plain is in that list by default. With alias, the file sits outside the web root and can be shared across all server blocks, for example through an include of a common snippet. For key files under /.well-known/, add a second location with default_type application/pgp-keys if needed.
After every change, run nginx -t to test the configuration, then reload.
IIS and Azure App Service
Microsoft's Internet Information Services only serves file types that have a MIME mapping. .txt has one, but without a charset; .asc key files have none, so IIS answers with 404. A web.config placed directly in the .well-known folder fixes both and keeps the change local to that folder:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<staticContent>
<remove fileExtension=".txt" />
<mimeMap fileExtension=".txt" mimeType="text/plain; charset=utf-8" />
<remove fileExtension=".asc" />
<mimeMap fileExtension=".asc" mimeType="application/pgp-keys" />
</staticContent>
</system.webServer>
</configuration>
The remove before each mapping avoids a configuration error when the extension is already defined further up. If IIS answers with substatus 404.8, request filtering is blocking the path as a hidden segment. By default that covers paths such as bin, App_Code and web.config, not .well-known; if someone added a custom rule for dot folders, it has to go. The substatus appears in the IIS log.
Azure App Service on Windows runs on IIS, so the same web.config applies. On Linux, the web server or the application itself decides how the file is served.
Cloudflare
If your domain is proxied through Cloudflare, you can serve the file at the edge, whatever runs behind it. That is also the way out for systems without file access.
The built-in security.txt
Since October 2024, Cloudflare has offered a security.txt in the dashboard, free for all customers according to its announcement. You find it under Security > Settings, filter Web application exploits, section Security.txt. Contact and the expiry date are required; Encryption, Acknowledgments, Canonical, Hiring, Policy and Preferred-Languages are optional. Cloudflare builds the file from these values on every request.
That is enough for a file under RFC 9116. The documentation does not mention fields such as CSAF or Bug-Bounty, nor your own OpenPGP signature. If you follow the TR or need a signed file, serve your own file instead, either from your server or from a Worker. The documentation also does not say what happens when a file exists on your origin as well, so check which version is delivered after switching it on.
Your own file via a Worker
A Worker on the route example.com/.well-known/security.txt serves a finished, signed file unchanged:
const SECURITY_TXT = `-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
Contact: mailto:security@example.com
Expires: 2027-10-01T00:00:00.000Z
...
-----END PGP SIGNATURE-----
`;
export default {
async fetch() {
return new Response(SECURITY_TXT, {
headers: { "content-type": "text/plain; charset=utf-8" }
});
}
};
Paste the file exactly as gpg --clearsign produced it. For each additional domain or subdomain, add another route to the same Worker.
Bot protection: the most common trap
According to Cloudflare's documentation, the basic Bot Fight Mode cannot be bypassed for individual paths, neither with WAF custom rules nor with Page Rules. It answers automated requests with a challenge, and scanners, checkers and CERTs are exactly that. Exceptions for /.well-known/ require Super Bot Fight Mode, which supports skip rules (Pro plan and above). The same goes for your own rules with "Managed Challenge" or "JS Challenge": exclude /.well-known/security.txt and your key files. The checker shows whether bot protection gets in the way.
TYPO3
TYPO3 offers two clean routes.
Route 1: a file in the public folder
Put the file in public/.well-known/security.txt, or straight into the web root on older installations without Composer. The .htaccess shipped with TYPO3 blocks all hidden files and folders but explicitly exempts the content of /.well-known/. If your .htaccess was customised years ago and never refreshed, that exception is sometimes missing; compare it with the current template. Set the charset as described under Apache.
Route 2: a static route in the site configuration
Since version 9.5, TYPO3 supports static routes, meant for things like a separate robots.txt per site in a multi-site installation. The staticText type serves its content as text/plain; charset=utf-8. In the site's config.yaml:
routes:
- route: .well-known/security.txt
type: staticText
content: |
Contact: mailto:security@example.com
Expires: 2027-10-01T00:00:00.000Z
Preferred-Languages: en, de
Canonical: https://www.example.com/.well-known/security.txt
You can also create the route in the backend Sites module. The upside: every site in a multi-domain installation gets its own file with the right Canonical line. The downside: a signed file has to go into the block with every signature line, and each edit in the backend risks changing a character. For signed files, route 1 is safer. If a real file exists at the same path, the web server serves it before TYPO3 sees the request.
Shopify
Shopify gives you no access to server files. We could not find a feature in Shopify's help centre for placing your own files under /.well-known/. Posts in the Shopify Community report that paths under /.well-known/ can neither be created nor redirected through the store's URL redirects. We therefore know of no reliable solution within Shopify itself.
What remains:
- Store on a subdomain. If the store runs on
shop.example.comand the company site elsewhere, put the file on the company site. Under RFC 9116 it does not cover the store domain, but reporters will still find you through the main domain. - Ask Shopify support whether your plan offers a way. Keep the answer on file in case a customer or auditor asks.
- Make the contact visible in the store. A "Report a vulnerability" page with an address does not replace the file, but it helps people searching by hand.
GitHub Pages, Netlify, Vercel and Next.js
Static hosts serve whatever lands in the output directory. The problem is almost always getting it there: many build tools skip folders that start with a dot.
GitHub Pages with Jekyll
According to GitHub's documentation, Jekyll does not build files and folders whose names start with _, . or # unless they are listed in the include setting. In _config.yml:
include:
- .well-known
If you do not need Jekyll at all, an empty .nojekyll file in the root turns the build off, and all files are published as they are. With a custom domain, the file applies to that domain, not to name.github.io.
Netlify
Reports in Netlify's support forum say that the .well-known folder usually survives builds from a connected Git repository, while ZIP uploads and drag-and-drop deploys remove files and folders starting with a dot. Set the content type with a _headers file in the output directory:
/.well-known/security.txt
Content-Type: text/plain; charset=utf-8
If the folder still goes missing, users describe a workaround: name the folder well-known without the dot and rewrite it in _redirects with /.well-known/* /well-known/:splat 200. The status 200 makes it an internal rewrite rather than a visible redirect. Check the result after every deploy.
Next.js and Vercel
Next.js serves everything in the public folder from the root of the domain, so public/.well-known/security.txt appears at /.well-known/security.txt. According to the documentation, Next.js sends Cache-Control: public, max-age=0 for these files, so changes show up immediately. The documentation says nothing about dot folders; after the first deploy, check status and type with curl -sI.
Webflow, Framer, Wix and other site builders
With site builders, everything depends on whether the provider offers a feature for files under /.well-known/.
- Webflow describes a route through the Assets panel in its help centre: create a folder named
well-known, upload the file and publish; Webflow then serves it under/.well-known/. Text files such as.txtare allowed. Check Webflow's help centre for which plans include it. - Framer has a "Well-Known Files" feature in the site settings.
- Wix: we could not find a feature for your own files under
/.well-known/in Wix's help centre.
For other builders, search the help pages for "well-known". If there is nothing, the remaining option is a service in front of the site such as Cloudflare (see Cloudflare), provided your builder allows a proxy in front of your custom domain. Clarify that with the provider first.
Multiple domains and subdomains
Under RFC 9116, a security.txt applies only to the host it was retrieved from (section 3.1). If you are reachable at example.com, www.example.com and shop.example.com, the file must be available at all three. There are three ways to get there:
- The same file on every host, served directly. The cleanest option. The file carries one Canonical line per host, is signed once and served unchanged on each host, for example with
Aliason Apache,includeon nginx or Worker routes on Cloudflare. - A redirect to a central file. RFC 9116 allows redirects on retrieval (section 3) but advises reporters to inspect every redirect, since it may lead to a domain controlled by someone else (section 5.2). Some checkers therefore flag a redirect to another domain as a warning.
- A separate file per host. Needed when individual hosts have different contacts, for instance a subsidiary.
Multiple Canonical lines are explicitly intended; RFC 9116 itself shows an example with two URIs (section 2.5.2). The reverse matters too: if the file is retrieved from a URI that is not listed in any Canonical line, its contents should not be trusted.
Canonical: https://example.com/.well-known/security.txt
Canonical: https://www.example.com/.well-known/security.txt
Canonical: https://shop.example.com/.well-known/security.txt
Under the TR, the Canonical URI must be reachable without redirects (4.2.2 c). The first option meets that on every host.
How to check the result
After setting it up, and after every migration, update or change of host, check from the outside, not from the server itself:
curl -sI https://www.example.com/.well-known/security.txt
curl -s https://www.example.com/.well-known/security.txt | gpg --verify
curl -s https://example.com/.well-known/security.txt | sha256sum
curl -s https://www.example.com/.well-known/security.txt | sha256sum
- The first command must show status 200 and
content-type: text/plain; charset=utf-8.text/htmlalmost always means an error page. - The second reports "Good signature" if the platform serves the signed file unchanged and your key is in your keyring.
- The last two must return the same checksum if every host is meant to serve the same file.
The checker makes this easier: it fetches the file, spots error pages and bot protection, and checks type, fields, Canonical, keys and signature. Typical mistakes are also listed in the guide.
After an update or migration the file often disappears without anyone noticing. Monitoring checks it every day and alerts you when something is wrong, for 60 euros net per year per domain.
Frequently asked questions
Where exactly does security.txt go?
At https://your-domain/.well-known/security.txt, in the .well-known folder of your web root. The legacy location /security.txt may exist as well or redirect there.
Can I add security.txt to WordPress without a plugin?
Yes, and it is usually the more robust option: upload the file via SFTP or the file manager into a .well-known folder next to wp-config.php. The web server serves it before WordPress sees the request. You only need a plugin if your host gives you no file access.
Why does my server return 403 or 404 for /.well-known/?
Usually a hardening rule blocks every path starting with a dot, or the upload tool skipped the folder. On IIS, .asc files often lack a MIME mapping. The Apache, nginx and IIS sections show the right exception.
Is Cloudflare's security.txt feature enough?
For a file under RFC 9116, yes. If you follow BSI TR-03183-3 or want to sign the file, serve your own file from a Worker or your server, since the documentation mentions neither signatures nor fields such as CSAF. Either way, bot protection has to let the path through.
Do I need separate files for www and the bare domain?
The file has to be reachable at both, because it only applies to the host it was retrieved from. It can be the same file, with one Canonical line for each address.
Can /security.txt redirect to /.well-known/security.txt?
Yes, RFC 9116 provides for exactly that for legacy compatibility. The file under /.well-known/ itself should be served directly; under the TR, the Canonical URI must be reachable without redirects.
What if my shop system or site builder does not allow custom files?
Check whether the provider has a feature for files under /.well-known/. If not, put the file on your main domain when the shop runs on a subdomain, or serve it through a service in front of the site such as Cloudflare, if the provider allows it.
Sources
- RFC 9116: A File Format to Aid in Security Vulnerability Disclosure, sections 2.5.2, 3, 3.1 and 5.2, IETF, April 2022.
- BSI TR-03183-3 Vulnerability Reports and Notifications, version 1.0.0, sections 4.2.1, 4.2.2 and 4.2.11, Federal Office for Information Security (BSI), 20 August 2025.
- Security.txt Manager, WordPress plugin directory, retrieved 27 October 2026.
- Module ngx_http_charset_module and location, nginx documentation.
- Adding Static Content MIME Mappings <mimeMap> and Hidden Segments <hiddenSegments>, Microsoft Learn.
- Set up your security.txt file, Cloudflare documentation, and Cloudflare blog post on security.txt, October 2024.
- Bot Fight Mode, Cloudflare documentation, section Limitations.
- Static routes, TYPO3 documentation, plus the shipped
.htaccesstemplate and theStaticRouteResolverclass in the TYPO3 source code. - Is it possible to edit /.well-known files?, Shopify Community.
- About GitHub Pages and Jekyll, GitHub documentation.
- Netlify deploy API removes files and directories beginning with a period and How to add a .well-known folder to my website, Netlify support forum.
- public Folder, Next.js documentation.
- Upload a well-known file, Webflow help centre.
- Well-Known Files, Framer.