# Custom domains

Every site has a Rimfe address, `your-address.rimfe.page`. With any Docs tier you can serve it from your own domain instead. A site has one active address: once your domain is live, the Rimfe address redirects to it.

## Add a domain

<Steps>
<Step>

### Add the domain

Open the site's **Publish** tab, then **Domains**, and choose **Add domain**. Enter a subdomain such as `docs.example.com`. An apex domain such as `example.com`, an IP address and a Rimfe address are refused. A domain that contains a bank, payment or big consumer brand name, or a non-ASCII (`xn--`) label, is added but waits for Rimfe to review it before any records show.

<img src="/images/platform/domain-add.webp" alt="Add a domain dialog with docs.acme.dev" width={464} height={276} />

</Step>
<Step>

### Add the CNAME record

The new domain shows one record to add at your DNS provider:

| Record | Name | Value |
| --- | --- | --- |
| **CNAME** | Your domain | The target shown on the page |

Use the copy buttons so the values are exact. That record routes the domain to Rimfe and gets its certificate issued.

</Step>
<Step>

### Wait for the certificate

Choose **Check now** once the record is in place. DNS changes can take a while to spread, and Rimfe also checks every week. The domain moves from **Waiting for DNS** to **Issuing certificate** to **Live**. If Cloudflare reports a problem, such as a CAA record that blocks the certificate authority, the page shows it.

</Step>
</Steps>

## Move a live domain without downtime

If the domain already serves another site, open **Move without downtime** under the domain. Add what it lists first: a TXT record that proves the domain is yours, and the certificate's TXT record or file on the site that serves the domain today. Change the CNAME once the domain shows **Issuing certificate** or **Live**, so the certificate is ready before traffic arrives.

## Statuses

<img src="/images/platform/domains.webp" alt="Domains page with the site address" width={900} height={563} />

| Status | Meaning |
| --- | --- |
| **Pending** | Waiting for the CNAME or for the certificate. |
| **Live** | The domain serves the site over HTTPS. |
| **Suspended** | The plan no longer includes custom domains. The domain stops serving 14 days after a downgrade and comes back after an upgrade. |
| **Failed** | The record was not found within 7 days. Check it, then remove the domain and add it again. |

A domain whose CNAME stops pointing at Rimfe is released, so whoever controls it can connect it again.

## When Rimfe asks for a TXT record

Adding a domain shows a TXT record to prove it is yours when:

- another workspace added the domain but never connected it,
- another workspace used the domain before, or
- the domain already points at Rimfe, for example because a CNAME was left in place after the domain was removed.

Add that record, then add the domain again. Removing a domain from Rimfe does not remove its CNAME, so delete the record at your DNS provider too.

## Limits

A site has one custom domain. Once it is live it is the site's only address:

- The Rimfe address answers every path with a permanent redirect to the same path on your domain, so old links keep working.
- Canonical links, social tags, the sitemap, `robots.txt`, `llms.txt` and feeds use your domain. They change the moment the domain goes live, with no rebuild.
- A domain that is still waiting for DNS changes nothing: the Rimfe address keeps serving until it is live.

Remove the domain with **Remove** and the Rimfe address serves the site again. To use another domain, remove this one first. Each site has its own domain.

Custom domains come with every Docs tier. Without one, **Publish**, **Domains** links to **Billing**.

## Serve under a path

You can put a public site in a folder of your own website, like `https://example.com/docs`, instead of on its own domain. Your website forwards the folder to Rimfe with a rewrite, and readers never leave your domain.

1. Open **Domains** and, under **Serve under a path**, enter the public address, such as `https://example.com/docs`: https, with one to three lowercase folders and no query or port. Choose **Save**. To go back, clear the field and choose **Serve at its own address**. The site rebuilds so every page, image and link starts with `/docs`.
2. Add the rule Rimfe shows for your host. The rules forward `/docs` and everything under it to the same path on your Rimfe address:

<Tabs>
<Tab title="Cloudflare Workers">

Add a Worker on the route `example.com/docs*`:

```js
export default {
  async fetch(request) {
    const url = new URL(request.url);
    url.hostname = "your-site.rimfe.page";
    return fetch(new Request(url, request));
  },
};
```

</Tab>
<Tab title="Vercel">

In `vercel.json`:

```json
{
  "rewrites": [
    { "source": "/docs", "destination": "https://your-site.rimfe.page/docs" },
    { "source": "/docs/:path*", "destination": "https://your-site.rimfe.page/docs/:path*" }
  ]
}
```

</Tab>
<Tab title="Next.js">

In `next.config.ts`:

```ts
import type { NextConfig } from "next";

const config: NextConfig = {
  async rewrites() {
    return [
      { source: "/docs", destination: "https://your-site.rimfe.page/docs" },
      { source: "/docs/:path*", destination: "https://your-site.rimfe.page/docs/:path*" },
    ];
  },
};

export default config;
```

</Tab>
</Tabs>

3. Choose **Check**. Rimfe asks your folder which site answers, and says whether it works or what to fix.

Links you write as `/guides/install`, in pages or in settings, start from the docs folder, so they keep working. Your Rimfe address answers at `/docs` too, and its root forwards there. Canonical links, the sitemap and `llms.txt` use your public address.

Only public sites can be served under a path. Readers of a private site sign in on its own address. To make the site private, clear the public address first. A site is served under a path or on a custom domain, not both: remove the domain before you set a path.

### If it doesn't work

| What you see | What to fix |
| --- | --- |
| A 404 at `/docs` itself | Add a rule for the folder alone, not only for what's under it. |
| Pages without styles, search or images | The proxy must forward everything under the folder, including the `/docs/_rimfe/` paths. |
| A redirect loop | Use a rewrite, which keeps the address, not a redirect. |
| Old pages after a change | Purge your proxy's cache for the folder. |

Visitor analytics and per-visitor limits see your proxy's network rather than each reader.
