Skip to Content
BlogFrameBlogFrame

Add a blog to Cloudflare

If your domain runs through Cloudflare, a small Worker serves a BlogFrame blog at yourcompany.com/blog. Or add one CNAME for blog.yourcompany.com.

When your domain's traffic goes through Cloudflare, a Worker on the route yourcompany.com/blog* can forward the folder to BlogFrame before the request ever reaches your site. That also covers sites on Cloudflare Pages and sites whose code you can't change.

AddressExampleOn Cloudflare
Subdomainblog.yourcompany.comEvery plan, including Free
Subfolderyourcompany.com/blogCreator and up

Subdomain

Open your project in the dashboard and enter the subdomain you want, for example blog.yourcompany.com. The dashboard shows the CNAME record to add.

Add the CNAME in your domain's DNS records in the Cloudflare dashboard.

Wait for the record to apply. This usually takes a few minutes and can take up to an hour. BlogFrame sets up SSL for you.

Subfolder

The route only runs for traffic that goes through Cloudflare's proxy (the orange cloud on your main domain's record). In your project, enter yourcompany.com/blog under Subfolder on your website. The dashboard shows the rule with your project's real address in place of <your-project>. Add it, deploy, then click Check connection.

Cloudflare

In A Worker on the route yourcompany.com/blog*:

export default {
  async fetch(request) {
    const url = new URL(request.url)
    const target = "https://customers.blogframe.app/_p/<your-project>/blog" + url.pathname.slice("/blog".length) + url.search
    return fetch(new Request(target, request))
  },
}

In Cloudflare: Workers → Create → paste this → Settings → Domains & Routes → add the route for your domain with /blog*.

Tips for Cloudflare

  • Check with your website host that it supports running behind Cloudflare's proxy before you switch it on.
  • The Worker passes the visitor's query string through, so tracking parameters keep working.

More on addresses: Connect your domain.