Cloudflare
Use this page when the site’s domain is set up through Cloudflare. The DNS can be at Cloudflare even if the pages themselves are built elsewhere; see WordPress and site builders.
What you paste
Section titled “What you paste”A Worker. The app shows it under Setup → Connect your website with the values filled in; copy it from there with Copy setup snippet. The shape is:
addEventListener("fetch", (event) => { const url = new URL(event.request.url); const target = "https://proxy.simplifylocal.app/<business-id>" + url.pathname + url.search; event.respondWith(fetch(new Request(target, event.request)));});<business-id> is filled in by the app. Do not type it by hand.
Where it goes
Section titled “Where it goes”- Open
dash.cloudflare.comand sign in. From the account home, go to Workers & Pages → Create application → Create Worker. - Give the Worker a name (anything works, e.g.
simplifylocal). Click Deploy. - Click Edit code. Replace the example with the snippet, then click Save and Deploy.
- Back at the account home, click the site that matches the web address.
- Go to Workers Routes → Add route. Set the route to the address with the project-page path on the end,
yourbusiness.com/work/*, then pick the Worker you just deployed.
The route must cover /work* on the site’s own host. Add only this one route; do not add a route for /_next/*.
Verify
Section titled “Verify”Back in the app, click I added it. Check now. See Verify the connection for what each result means.
If the check reports We can’t reach your site, wait a couple of minutes and run it again without changing the snippet. Worker routes can take a moment to propagate.