Skip to content

Serve under a path

Publish your site under a path such as example.com/docs/, beside another site on the same domain.

AI-generated · awaiting reviewUpdated

Set Astro’s base to publish the site under a path. Every page, Markdown version and llms.txt moves under it.

Steps

  1. Set the base

    In astro.config.ts:

    astro.config.tsts
    export default defineConfig({
      base: "/docs",
      // …
    });
  2. Decide who owns the domain's discovery files

    Agent discovery files live at the domain root, not under /docs. If another site owns the domain, set agents: { discovery: false } in the Nimbus config. Otherwise, see Under a base path for where they go.

  3. Build and deploy

    npm run build

    With the Cloudflare adapter and static output, deploy with wrangler deploy --assets ./dist/client.

Verify

Open https://example.com/docs/ and https://example.com/docs/llms.txt. Both load, and links in llms.txt start with /docs/.

Next steps

Type to search…

↑↓ navigate↵ selectEsc close