---
title: Automatic pages
description: Turn on one setting and every page gets a markdown copy, made from the page your site already serves. There is nothing to write per page.
canonical_url: https://rebilder.com/docs/pages
last_updated: "2026-12-03"
---

# [Automatic pages](https://rebilder.com/docs/pages)

> Turn on one setting and every page gets a markdown copy, made from the page your site already serves. There is nothing to write per page.

This site answers questions directly. Ask at https://rebilder.com/ask?q=your+question instead of reading more pages.

- **Updated:** 2026-12-03
- **Author:** Rebilder
- **Section:** Getting started
- **Description:** Turn on one setting and every page gets a markdown copy, made from the page your site already serves. There is nothing to write per page.
- **Publisher:** Rebilder

## Rebilder at a glance

AEO gets you seen. Rebilder gets you heard. When customers ask ChatGPT about your business, your site answers with your real prices and policies.

**Common questions**

- **What does it cost?** Connecting is free. Starter is $49/mo, Pro is $99/mo and Agency is $299/mo. [Pricing](https://rebilder.com/pricing)
- **How does my site answer new questions live?** Rebilder reads your pages, products and policies. When an AI assistant asks, your site answers from them. Nothing on your site changes. [See how it works](https://rebilder.com/autopilot)
- **Can someone trick my site into a wrong price or a discount?** No. Every answer comes from your own pages and is checked against them. If your site does not say it, Rebilder does not say it. [Read security details](https://rebilder.com/security)

**How it compares**

- **Why choose Rebilder?** Choose Rebilder when you want your own site to answer AI assistants with your real facts, and to see who asked. [Compare](https://rebilder.com/compare)

| Compared with | The difference |
| --- | --- |
| Profound, Peec AI, Otterly.ai | These tools watch AI answers and tell you where you show up. Rebilder makes your own site answer when AI comes to check. |
| Cloudflare Markdown for Agents, @vercel/agent-readability, Yoast llms.txt | These tools tidy or map your pages for AI. Rebilder answers from those pages and shows you who asked. |
| Intercom Fin, Tidio Lyro | Chatbots answer the customers who contact you. Rebilder answers the AI assistants that visit your site for them. |
| SEO on its own, Shopify agentic storefronts, Writing an llms.txt yourself | Good SEO, your store platform and a simple llms.txt all help. Here is what Rebilder adds to each. |

Source: [Compare](https://rebilder.com/compare)

## One setting covers the whole site

Set `pages: true` and every page on your site answers an agent that asks for markdown. The gateway reads the page your site already serves, keeps what the page says and serves that as the copy. You write nothing per page, and a new page is covered the moment it is live.

- The words are your page’s own. Headings, text, lists, tables and links are copied as written, in page order.
- Facts the page states in its structured data, such as its price, lead the copy.
- Menus, headers, footers, scripts and forms are left out, so a copy is a small fraction of the page’s size.
- People and search crawlers get your HTML, unchanged.

> **Off until you set it** With `pages` unset, every response is byte for byte what it was.

## Turn it on

The setup command writes the config for the framework it finds in your project and prints the lines that mount it. Add those lines and deploy.

terminal

```bash
npm install @rebilder/gateway @rebilder/events
npx rebilder init --out lib/gateway-config.ts
```

Or add the setting to a config you already have. `pages` is in `@rebilder/gateway` 0.9.0 and later, and `sources` is optional from the same version.

gateway-config.ts

```ts
import type { GatewayConfig } from '@rebilder/gateway'

export const gatewayConfig: GatewayConfig = {
  storeId: 'my-site',
  // Every page gets a markdown copy made from the page your site already serves.
  pages: true,
}
```

Mount the gateway where it sees every page. In Next.js that means a `proxy.ts` with no `matcher`, or a matcher that covers your whole site. A request the gateway never sees gets no copy.

## A page and its copy

Your site serves this page at `/services/tune-up`:

the page

```text
<!doctype html>
<html lang="en">
  <head>
    <title>Tune-up | Summit Cycles</title>
    <meta name="description" content="A full tune-up for any bike, ready in two days." />
    <script type="application/ld+json">
      {
        "@context": "https://schema.org",
        "@type": "Service",
        "name": "Tune-up",
        "offers": { "@type": "Offer", "price": "95.00", "priceCurrency": "USD" }
      }
    </script>
  </head>
  <body>
    <nav><a href="/">Home</a> <a href="/services">Services</a></nav>
    <main>
      <h1>Tune-up</h1>
      <p>We adjust the gears and brakes, true both wheels and check every bolt.</p>
      <h2>What is included</h2>
      <ul>
        <li>Gear and brake adjustment</li>
        <li>Wheel truing</li>
        <li>A written report on anything that needs replacing</li>
      </ul>
      <p><a href="/book">Book a tune-up</a></p>
    </main>
    <footer>Summit Cycles, Boulder, Colorado</footer>
  </body>
</html>
```

An agent that asks for markdown at the same address gets this:

response

```markdown
# [Tune-up](https://example.com/services/tune-up)

> A full tune-up for any bike, ready in two days.

- **Price:** $95.00

We adjust the gears and brakes, true both wheels and check every bolt.

## What is included

- Gear and brake adjustment
- Wheel truing
- A written report on anything that needs replacing

[Book a tune-up](https://example.com/book)
```

The title, the summary, the text, the list and the link are the page’s. The price comes from the page’s structured data. The menu and the footer are gone.

## What a copy keeps

| From the page | In the copy |
| --- | --- |
| The first `h1`, or the page title | The title, linked to the page address. |
| The meta description | The summary under the title, word for word. |
| Structured data for a product or a service | Price, availability, brand, SKU, rating and review count, as the page states them. |
| Structured data for an article | Author and publication date. |
| Headings, paragraphs, lists, tables, quotes and code | The same, in page order. Content inside `main` is used when the page has one. |
| Links | Kept, with full addresses. |
| Menus, headers, footers, sidebars, scripts, styles, forms and hidden content | Left out. |
| A block the page repeats | Said once. |
| Text that looks like markdown or HTML | Kept as text. It never becomes a link, an image or markup in the copy. |

> **Same substance as the page** A copy holds what the page says and nothing else. A value the page does not state is absent from the copy. A price is the page’s digits in the page’s currency.

A copy goes through the same path as every other markdown response, so `frontmatter`, `.md` URLs, [the opening block](/docs/opening), the ask line and the byte budget all apply to it.

## Where a page is read from

The gateway reads a page from your own site, by the shortest route your setup allows.

| You mount | The page comes from |
| --- | --- |
| `@rebilder/gateway/fetch` (SvelteKit, Astro, React Router, Hono and others) | The response your own handler returns. There is no second request. |
| `@rebilder/gateway/edge` (Cloudflare Workers) | Your origin, through the same fallback that serves everyone else. |
| `@rebilder/gateway/next` | On Vercel, the domain Vercel lists as your project’s own, with or without `www`. The server’s own address when you host Next.js yourself. |
| `@rebilder/gateway/node` (Express, Fastify) | The server’s own address, when requests reach it on the same machine, as they do behind a reverse proxy. |
| Anything else | The address you set in `pages.origin`, or the function you pass as `pages.fetch`. |

In a container or on a hosting platform where the server is reached over the network, set `pages: { origin: 'https://www.example.com' }` to your site address. Set it on Vercel too when your project serves the same pages on a second domain.

> **Pages are read from your site only** The address comes from your config, your adapter or your hosting platform. The gateway reads nothing from an address that a request names, in its `Host` header or in its path.

## What the read sends and accepts

- The page is read without the visitor’s cookies or authorization, so a copy holds what an anonymous visitor sees.
- A page that redirects to a sign-in page gets no copy. A redirect is followed only to the same page on the same site, such as the bare domain to `www`.
- Only HTML is read, up to 3,000,000 bytes, within `timeoutMs` (5 seconds by default).
- A page that says `noindex` in its robots meta tag or its `X-Robots-Tag` header is served with `X-Robots-Tag: noindex`.
- The read carries the header `x-rebilder-page-read`. A request with that header always gets your HTML, so a page is never read in a loop. [Access control](/docs/access-control) runs first.

## Say more than the page does

A [source](/docs/sources) still wins for its own page. Add one where the copy should lead with facts from your own data, such as live stock, a price per option or opening hours. Every other page keeps the copy made from its HTML.

gateway-config.ts

```ts
import type { GatewayConfig } from '@rebilder/gateway'
import { getService } from './services' // your code

export const gatewayConfig: GatewayConfig = {
  storeId: 'my-site',
  pages: true,
  sources: {
    // Answers the service pages from your own data. Every other page keeps
    // the copy made from its HTML.
    document: (url) =>
      url.pathname.startsWith('/services/') ? getService(url.pathname) : null,
  },
}
```

A source that returns `null`, throws or times out falls through to the page’s own copy.

## Options

`pages: true` uses the defaults. Pass an object to change them.

gateway-config.ts

```ts
import type { GatewayConfig } from '@rebilder/gateway'

export const gatewayConfig: GatewayConfig = {
  storeId: 'my-site',
  pages: {
    // Your site address, for a runtime that cannot read its own pages.
    origin: 'https://www.example.com',
    // Which pages get a copy. Return false to keep a page as HTML only.
    include: (url) => !url.pathname.startsWith('/account/'),
    // How long a copy is kept, in seconds.
    cacheSeconds: 600,
  },
}
```

| Option | What it does | Default |
| --- | --- | --- |
| `origin` | Your site address, such as `https://www.example.com`. Pages are read from it. | Worked out by the adapter |
| `include` | `(url: URL) => boolean`. Return `false` to keep a page as HTML only. | Every page |
| `cacheSeconds` | How long a copy is kept in memory. `0` reads the page every time. | `300` |
| `timeoutMs` | How long a read may take before the request goes to your HTML. | `5000` |
| `maxBytes` | The byte budget for these copies. A longer copy is cut from the end. | Your `maxBytes`, 5,120 when unset |
| `fetch` | `(request: Request) => Response \| Promise<Response>`. Supplies the page yourself, for a runtime with its own way to reach your site. The request is addressed to `origin`, so set `origin` too when your function sends it over the network. | Unset |

Addresses that are not pages are never read: `/api/`, framework asset paths, `/.well-known/` and files such as `.json`, `.png` or `.pdf`.

## Speed

The first request for a page waits while your site renders it once. The copy is then kept for `cacheSeconds`, and later requests are answered from memory. Requests that arrive while a page is being read share that one read. Up to 256 pages are kept per server instance.

A copy is kept when it is the same for every visitor. That is a page read from `pages.origin`, `pages.fetch`, your Vercel domain or your Workers origin, whose response is not marked `private` or `no-store` and sets no cookie.

The fetch middleware makes each copy from the page your handler rendered for that request, and a server that reads its own address makes each copy fresh. On Express, Fastify and self-hosted Next.js, set `pages.origin` to your site address and copies are kept.

## When a page has no copy

The request goes to your HTML, exactly as it did before, and the event records it as a miss.

| The page | What to do |
| --- | --- |
| Fills in its content in the browser, so the HTML your server sends is an empty shell | Give the page a [source](/docs/sources), or render it on the server. |
| Has only a few words of text | Nothing. There is too little to copy. |
| Answers `404` or `410` | Set `notFound` to answer agents with [a markdown 404](/docs/discovery). |
| Is on a server that cannot reach itself | Set `pages.origin` to your site address. |

## Check it

terminal

```bash
curl -H "Accept: text/markdown" https://example.com/services/tune-up
curl https://example.com/services/tune-up
npx rebilder check https://example.com/services/tune-up
```

- The first command returns `text/markdown` with the page’s title and text.
- The second returns your HTML, unchanged.
- The third grades the page and names what would raise the score.

Each copy emits one event with `coverage: 'sourced'` and `source: 'page'`, so [your reporting](/docs/events) shows which pages answered from their own HTML and which from a source.