Domain Restriction
Domain restriction lets you choose which websites can submit to your form. When it’s on, Formtorch accepts a submission only if the visitor’s browser says it came from one of your allowed domains. Everything else is rejected with 403 Forbidden and is not saved.
It’s useful when your form lives on a known site and you don’t want your form ID reused on another website.
Domain restriction filters browser traffic. It isn’t authentication. Any
script or server can send whatever Origin header it likes, so don’t rely on
it to block determined bots. Pair it with TorchWarden™, the honeypot, or
CAPTCHA.
How it works
Formtorch reads the request’s Origin header. Only if Origin is absent does it fall back to the Referer header.
- Allowed: the hostname matches an entry on your list exactly.
- Rejected (
403):- the hostname isn’t on your list;
Originisnull, empty, or malformed (Formtorch never falls back toRefererin this case);- both headers are missing, which is typical of server-side code.
The same check applies to file upload requests, so a rejected website can’t upload files either.
Domain restriction is off by default for every form. On the Free plan it isn’t enforced. If you downgrade, your settings are kept, and restriction resumes automatically with your saved domains when you upgrade again.
Setting up an allowlist
Open your form settings
In the dashboard , open your form, then Settings and the Allowed Domains card.
Add allowed domains
Enter each domain and click Add. You can paste a full URL; Formtorch keeps just the hostname. You can add up to 10 domains.
Turn it on and save
Switch on Only accept submissions from allowed domains and click Save. Formtorch asks you to confirm and then emails you a summary with testing tips. Changes apply to new submissions immediately.
Matching rules
Matching is exact. There are no wildcards and no automatic subdomains.
| Allowed entry | Accepts | Does not accept |
|---|---|---|
example.com | https://example.com, http://example.com | www.example.com, shop.example.com |
www.example.com | https://www.example.com | example.com |
staging.example.com | https://staging.example.com:8443 | example.com, www.staging.example.com |
localhost | http://localhost:3000, http://localhost:5173 | 127.0.0.1 |
- Both
httpandhttpsmatch. - Ports are ignored.
- Letter case doesn’t matter.
- Internationalized domains (for example
bücher.de) are stored in their ASCII form (xn--bcher-kva.de), the form browsers send.
If your site is reachable at both example.com and www.example.com, add both.
Development and testing
- Add
localhostwhile developing, then remove it before going live. Anyone can sendlocalhostfrom their own computer. - Test submissions (
_test=true) are checked like any other submission. They don’t bypass domain restriction. - To check your setup, submit the form from each allowed website and confirm the submission appears in your dashboard.
Seeing rejected requests
The Allowed Domains card shows how many requests were rejected in the last 24 hours and 7 days, why they were rejected, and the most recent ones, with an Add to list shortcut for websites you recognize. If a form rejects a burst of requests, Formtorch emails you (at most once per form per day).
Rejected requests aren’t stored, so they can’t be recovered. They may be bots and scripts, or real visitors on a website you haven’t listed; only you can tell which.
Troubleshooting
Submissions from my own site are rejected. Check www versus non-www, and staging or preview hostnames. Each one needs its own entry.
The reason says Origin: null. A plain HTML form sends Origin: null when the page uses Referrer-Policy: no-referrer or same-origin, when it runs in a sandboxed iframe, or when it’s opened from a local file. JavaScript fetch requests always send their real origin, so switching the form to fetch also fixes it. A redirect on the way to Formtorch also makes browsers send Origin: null. www.formtorch.com and http:// URLs both redirect, so post to the exact https://formtorch.com/f/... or https://app.formtorch.com/f/... endpoint.
Requests from my server are rejected. Server-side code (including framework server actions) sends no Origin or Referer header. Submit from the browser instead, or turn domain restriction off.
I need to stop rejecting submissions now. Turn the switch off and click Save. Any website can submit again immediately, and your domain list is kept.