Setup guide · Cloudflare Pages

Serve ConveyLoop’s SEO pages from a static site on Cloudflare Pages

Five rewrite rules and one line in robots.txt. No code, and no build step.

← How Git publishing works

Before you start

  • A static site that Cloudflare Pages deploys from a repository on GitHub.com, GitLab.com or Bitbucket Cloud: HTML files you commit, which Pages publishes as they are.
  • Built with a framework, such as Next.js, Astro or Hugo? This guide isn’t the one: the framework decides what gets published. For Next.js, see the Next.js guide.
  • Tested on Cloudflare’s free plan with its default settings, and the connection’s defaults: Standalone HTML, the Target subdirectory /conveyloop/seo, and pages served at /guides. If yours differ, the Git window shows them: use your values where the rules have these.

1. Connect your repository

In ConveyLoop, open Project setup and connect Git. Choose the repository and the Pages project’s production branch, and keep Standalone HTML: each page is then a complete document with ConveyLoop Metrics built in, which Pages serves as it is.

Pages publishes one folder of your repository: the Build output directory in the project’s build settings. ConveyLoop’s folder has to be inside it:

  • Build output directory empty, or /: keep the Target subdirectory /conveyloop/seo.
  • Build output directory set, for example to public: set the Target subdirectory to /public/conveyloop/seo. The rules below stay exactly the same, because Pages serves the folder at /conveyloop/seo either way.

2. Add the rewrite rules

Put these lines in a file named _redirects at the top of the build output directory, next to your home page.

_redirects
# ConveyLoop's pages, served at /guides
/guides               /conveyloop/seo/content/_index   200
/guides/              /guides                          301
/guides/sitemap.xml   /conveyloop/seo/sitemap.xml      200
/guides/:page/        /guides/:page                    301
/guides/*             /conveyloop/seo/content/:splat   200
  • A 200 makes a rule a rewrite: the address stays /guides/example-page, and Pages answers with the file from ConveyLoop’s folder.
  • The rules name the pages without .html. Pages serves example-page.html for example-page, and sends any address ending in .html to the one without it, so a rule naming the .html file would send visitors to the folder’s own address instead.
  • The two 301 rules send /guides/ and /guides/example-page/ to the address without the slash, the one each page’s canonical link names.
  • The last rule serves the pages and their stylesheets. Any other address under /guides is your site’s 404.
  • Already have a _redirects file? Add these lines above any rule that matches /guides or everything: Pages uses the first rule that matches.
  • Serving under another path, such as /learn? Change every /guides in the rules.
  • Pages also serves the folder itself, at /conveyloop/seo/, as it does every file it publishes. Each page’s canonical link names its /guides address, so that is the one search engines index.

3. Keep a 404 page

Make sure the build output directory has a 404.html. Without one, Pages treats the site as a single-page app and answers every unknown address with your home page, pages ConveyLoop has removed included. Search engines then see those pages as still there, and ConveyLoop can’t tell a missing page from a live one.

4. Point search engines at the sitemap

The third rule serves the sitemap ConveyLoop keeps in its folder. Add its address to your robots.txt, using your site’s address, the same one your ConveyLoop project has. No robots.txt yet? Create one in the same folder as _redirects:

robots.txt
User-agent: *
Allow: /

Sitemap: https://www.example.com/guides/sitemap.xml

Already have one? Add just the Sitemap: line. A site can list several, so keep any you have. Search engines and ConveyLoop’s own crawl both read it.

5. Let ConveyLoop read the pages

  • Bot Fight Mode on your domain can turn ConveyLoop away, and Cloudflare doesn’t let a custom rule skip it. If ConveyLoop’s check says your site refused it, turn Bot Fight Mode off. On a paid plan, Super Bot Fight Mode can be skipped instead: add a WAF custom rule that skips it for requests whose User-Agent starts with ConveyLoopBot or ConveyLoop-Crawler, on your public pages, /guides among them, plus /robots.txt and /sitemap.xml (or the sitemap your robots.txt names). The crawl starts at your homepage, so skipping it only on /guides isn’t enough.
  • For any other firewall rule or bot protection, allow the same requests on the same paths. Keep the protection for everything else, such as login and account pages: a User-Agent is easy to fake.
  • A site behind Cloudflare Access or a password can’t be read by ConveyLoop or by search engines.

6. Publish and check

Commit the files, then publish a page. Each publish is a commit, and Pages deploys every commit to your production branch: in our test, a new page was live twenty seconds after it was committed. A few minutes after a publish, ConveyLoop fetches the page at its address, and the Git window shows Live on your site.

If the page isn’t there, the Git window says what ConveyLoop found instead and gives you a prompt for your AI coding agent that fixes it.

Let your Cloudflare site publish its own SEO pages

Add the rules once. ConveyLoop writes the pages, commits them and keeps improving them.