Skip to Content
FeaturesCustom Redirects

Custom Redirects

Available on all plans. See pricing.

By default, Formtorch shows its own success page  after a form is submitted. You can override this and send visitors to your own page instead: a thank-you page, a pricing page, a calendar link, or anywhere else.

There are two ways to set a redirect:

  • Form Settings (recommended): set it once in the dashboard. Works with any HTTPS URL, on any domain.
  • _redirect field: set it per form in your HTML. Limited to the same site as the page your form is on.

Setting a redirect in Form Settings

Open your form settings

In the dashboard , open your form → Settings → Success Redirect.

Turn the redirect on

Enable the Redirect after submission toggle.

Enter your URL and save

Enter the destination URL, for example https://yoursite.com/thank-you, and click Save.

After a successful submission, Formtorch redirects the browser to that URL. That’s it.

The URL must:

  • be a full URL starting with https:// (plain http:// and other schemes are rejected)
  • not contain a username or password (such as https://user:pass@yoursite.com)
  • be 2048 characters or fewer

Any domain is allowed, including one different from the site your form is on.

Turning the redirect off keeps the URL saved, so you can turn it back on later without re-entering it.

Setting a redirect with _redirect

You can also add a hidden _redirect field to your form:

<form action="https://formtorch.com/f/YOUR_FORM_ID" method="POST"> <input type="hidden" name="_redirect" value="https://yoursite.com/thank-you" /> <input type="text" name="name" placeholder="Your name" /> <input type="email" name="email" placeholder="Your email" /> <button type="submit">Submit</button> </form>

Because anyone can edit a hidden field, _redirect is restricted to protect your visitors from phishing:

  • The destination must be on the same site (origin) as the page containing the form. Formtorch checks this against the browser’s Referer header, so the redirect is skipped if the browser doesn’t send one.
  • Relative paths such as /thank-you are supported and resolve against the page the form is on.
  • javascript:, data:, and other non-HTTP schemes, URLs with a username or password, and URLs over 2048 characters are ignored.

If _redirect fails these checks, visitors see the default success page instead. To redirect to a different domain, use Form Settings.

Which redirect wins

For a successful submission from a regular HTML form, Formtorch uses the first of these that applies:

  1. The Form Settings redirect, if it’s turned on
  2. A valid _redirect field
  3. The default Formtorch success page

When the Form Settings redirect is on, it overrides any _redirect field in your HTML.

AJAX and fetch submissions

If you’re submitting the form via JavaScript (fetch or XMLHttpRequest), neither redirect applies. Instead:

  • Include X-Requested-With: XMLHttpRequest in your headers
  • Formtorch returns a JSON response instead of redirecting
  • Handle the success state yourself in your JavaScript
const res = await fetch("https://formtorch.com/f/YOUR_FORM_ID", { method: "POST", headers: { "X-Requested-With": "XMLHttpRequest" }, body: new FormData(formEl), }); if (res.ok) { // Show your own success message }

Always send the X-Requested-With header from JavaScript. Without it, Formtorch treats the request as a regular form post and responds with a redirect, which fetch follows in the background instead of navigating the page.

Reserved fields

Fields prefixed with _ are control fields and are not stored as submission data:

FieldPurpose
_redirectSame-site URL to redirect to after submission
_formNameOverride the form name shown in notification emails
_testMark submission as a test (set to true)
_honeypotHidden honeypot field (leave empty)
_honeypotFieldCustom honeypot field name
  • Email Notifications: configure who receives submission notifications
  • Spam Protection: submissions flagged as spam are stored and flagged, and still receive a success response so bots can’t tell they were caught. They are never sent to your Form Settings redirect.
Last updated on