Webflow sync, pageviews & more.
NEW

Why is my form in Webflow not submitting on my live environment but is submitting on my staging environment? I am receiving an internal server error (http code 500) and a CORS policy error message. How can I resolve this issue?

TL;DR
  • Ensure the form action is handled by Webflow (use action="#"), not a custom endpoint.
  • Review and adjust custom code to avoid interception or CORS violations, especially in Project Settings.
  • Confirm your live domain is properly added and verified in Hosting > Custom Domains.
  • Check server logs for HTTP 500 errors and ensure it accepts requests from your live domain.
  • Make sure the server returns correct CORS headers (Access-Control-Allow-Origin) for your live domain.
  • Use browser DevTools to inspect network requests and identify any CORS or submission errors.

Your Webflow form is likely failing on the live environment due to CORS policy violations or server misconfigurations causing an HTTP 500 error. This typically differs from staging due to custom code or domain mismatch.

1. Check Form Action and Method

  • Go to Designer > Select the Form Wrapper.
  • Ensure the Form Action is not manually pointing to a third-party endpoint or custom server unless required.
  • Webflow-native forms should have no action or use action="#" (Webflow handles this internally).

2. Compare Custom Code Between Environments

  • Go to Project Settings > Custom Code (Head and Footer).
  • Look for any JavaScript that might intercept form submission (e.g., with fetch() or XMLHttpRequest).
  • If you’re making API calls to a custom server or service, ensure CORS headers (like Access-Control-Allow-Origin) are properly configured to include your live domain.

3. Check Domain Whitelisting in Webflow Settings

  • If you're using Webflow’s built-in form handling, make sure your live custom domain is published and connected properly.
  • Webflow form submissions will fail if the domain isn’t added and verified under Hosting > Custom Domains.

4. Handle HTTP 500 Server Errors

  • An HTTP 500 error usually implies that the server receiving the submission had an internal processing issue.
  • If you're not using Webflow forms and are submitting to a custom server, check:
  • The server logs to identify the cause.
  • That the server supports requests from both staging and production domains.

5. Verify CORS Policy at the Server Level

  • Your server or third-party endpoint must return the correct CORS headers.
  • The most critical one is:
    Access-Control-Allow-Origin: https://your-live-domain.com
  • A wildcard (*) may also be used, but it doesn't work for authenticated requests.

6. Test Form Locally and in DevTools

  • Use DevTools > Network tab to check:
  • The actual request URL.
  • Whether there are preflight (OPTIONS) requests that fail.
  • The exact CORS error message for clues on what’s missing or blocked.

Summary

Your form fails on the live site due to a CORS error and server issue, likely tied to domain misconfiguration or custom code. Ensure your live domain is whitelisted, custom endpoints allow CORS from that domain, and remove any custom form logic that could interrupt Webflow's default handling.

Rate this answer

Other Webflow Questions