How to host a Framer export on Cloudflare Pages
To host a Framer export on Cloudflare Pages, unzip the WebExport download and run npx wrangler pages deploy ./exported-site --project-name my-site. Add a _headers file for script caching, rebuild your Framer redirects in _redirects, and swap Framer form endpoints. Check that no request still goes to framerusercontent.com.
Last reviewed
Key facts
- Framer says a published site cannot be exported as plain HTML, so the copy is a saved render.
- A _headers file can hold up to 100 rules, each line up to 2,000 characters.
- The same header set by two matching rules is joined with a comma, which breaks Cache-Control.
- Cloudflare Pages already adds nosniff and a referrer policy by default.
What a Framer export brings to Cloudflare Pages
A Framer page loads JavaScript modules that build the layout in the browser. WebExport saves the rendered HTML with the modules, Framer Motion bundles, fonts and images, and rewrites paths to local files. Cloudflare Pages serves the modules from its network, so animations start from your own files.
Because Pages sets some security headers for you, a Framer export needs fewer rules than on other hosts. The useful additions are caching for the script modules and a couple of restrictions. Start with the smallest file that does the job and add rules only after you see a problem in the browser.
Deploy with Wrangler direct upload
- Unzip the download into a folder that holds index.html at the top.
- Create a Pages project once, then deploy the folder to it.
- Open the pages.dev address the command prints and test a few URLs.
- Attach your domain from the project’s custom domains tab.
npx wrangler pages project create my-site
npx wrangler pages deploy ./exported-site --project-name my-siteRedirects, headers and 404s on Cloudflare Pages
Cloudflare Pages reads _redirects and _headers from the output directory. A redirect line is the source, the destination and an optional status code, and the default is 302, so write 301 for permanent moves. The limits are 2,000 static and 100 dynamic redirects, with each declaration capped at 1,000 characters, and 100 rules in _headers. If the folder has no 404.html, Pages answers unknown paths with the root index.html, so add a 404.html to get real 404 responses.
This _headers file adds a one hour cache for script modules and two restrictions. It avoids headers that Pages already sets, because a duplicate would be joined into one comma separated value.
/*
X-Frame-Options: SAMEORIGIN
Permissions-Policy: camera=(), microphone=(), geolocation=()
/*.mjs
Cache-Control: public, max-age=3600A path line starts at the left edge and its headers are indented. If you later need to remove a header another rule added, write the header name with an exclamation mark in front. Keep Cache-Control on one rule only, since two matching rules would join their values.
Framer output that needs fixing on Cloudflare Pages
| In the Framer output | What to do on any static host |
|---|---|
| Script modules from framerusercontent.com | Framer pages hydrate with JavaScript modules. Open the network tab and confirm no request still goes to framerusercontent.com. |
| Animation that starts on load | A missing script path can leave elements hidden or unanimated. Compare the first screen against the live site. |
| Forms that submit to Framer | Forms built with Framer’s own components post to a Framer service. Switch them to a form endpoint you control. |
| Redirects set in Framer settings | They live in Framer, not in the files. Rebuild them in the host’s own redirect format before the domain moves. |
Open the deployed site with the network tab running and filter for framerusercontent. Each hit is a path the export missed, and you can edit the HTML to point at the local copy. Rebuild redirects from the Framer site settings in _redirects, and switch Framer form components to an endpoint you control. Check the first screen for hidden sections, which point to a script that did not load.
Forms and dynamic features
Static files cannot receive a POST. Either use a form service, or add a Pages Function under a functions folder that handles the request. Redirects and the _headers file do not apply to responses a Function generates.
A Pages Function in a functions folder can accept the form POST and send it on by email or to a database. A hosted form service is quicker if you only need submissions in your inbox.
What can go wrong
- Two rules that set Cache-Control for the same file produce an invalid combined header.
- Forgetting that redirects in Framer settings are not in the files leaves old links dead.
- A deployment without a 404.html lets unknown paths return the home page with a 200 status.
Frequently asked questions
Does Cloudflare Pages need a build for a Framer export?
No. Use direct upload with Wrangler and point it at the folder. There is no build command because the files are already finished.
How many header rules can I have on Pages?
Up to 100 rules in _headers, and each line can be 2,000 characters long. A Framer export rarely needs more than a handful.
Do _headers rules apply to my Pages Functions?
No. Cloudflare says headers in _headers are not applied to responses generated by Pages Functions. Set them in the function code.
Can I preview a Framer export before the domain moves?
Yes. Every deployment gets its own pages.dev address, and a branch flag in Wrangler creates a preview deployment you can share for review.
Official documentation
Free tools for this job
- Framer Site AnalyzerAnalyze fonts, colors, assets, and page structure of any Framer-published site.
- Framer Site Speed TesterRun performance checks on any Framer-published URL with actionable insights.
- Static Hosting PickerAnswer 5 questions and get the best hosting recommendation for your exported site.
- Static Site Hosting Cost CalculatorCompare hosting costs: Webflow vs Vercel vs Netlify vs Cloudflare Pages at scale.
Get the Framer files first
Paste your public Framer URL into the export form and download a ZIP you can deploy to Cloudflare Pages. The Free plan covers 1 site, 5 exports a month, 15 pages and 20 MB per export. Professional is a $9.99 one-time purchase with unlimited pages.