# Before Mounting EmDash on a Subpath: We Clicked Through Every Address Under /field-notes

> After you set base in Astro, which addresses move with it and which do not, plus a few places worth checking by hand before you go live.

Source: https://emdashcmseverything.com/docs/emdash-cms-astro-base-subpath-field-notes/

- Published: 2026-11-10

Putting a site under `example.com/field-notes/` instead of giving it a whole domain is a common requirement: the main site is some other system, and the blog is just a section hung beneath it.

The matching setting in Astro is a single line, `base`. So we assumed this guide would be short.

Then we created a new blog-template site, set `base: "/field-notes"`, built it, started it, and hit every address with curl. There was more to it than that one line. What follows is what we actually saw.

Test environment: EmDash 1.4.0, Node adapter, SQLite, the official blog template, with the template's 8 sample posts loaded through `emdash seed`.

```js
export default defineConfig({
  output: "server",
  base: "/field-notes",
  // ...
});
```

## Which addresses moved with base?

The good news first. The pages themselves are fine:

| Address | Result |
| --- | --- |
| `/field-notes/` | 200 |
| `/field-notes/posts` | 200 |
| `/field-notes/rss.xml` | 200 |
| `/field-notes/robots.txt` | 200 |

## Which addresses stayed where they were?

The admin and the API stay in place:

| Address | Result |
| --- | --- |
| `/_emdash/api/health` | 200 |
| `/_emdash/admin` | 302, redirects to `/_emdash/admin/setup` |

In other words, everything that starts with `/_emdash` does not move into `/field-notes`. Your routing rule in front has to send both `/field-notes/*` and `/_emdash/*` to this application. Send only the former and the admin will not open.

Two other addresses we ran into are worth mentioning: `/field-notes/_emdash/api/health` and `/field-notes/sitemap.xml` both return 500. They are not addresses anyone is supposed to visit, but if your check script works by "prepend the prefix and try again", they will give you a scare.

Something else surprised us: the root path `/` and `/posts` also return 200. That means the same content has two entry points. If you do not want search engines to see two copies, let your front routing pass only `/field-notes/*` and `/_emdash/*` and reject everything else.

## Not one link on the pages carries the prefix

This is the part we expected least. Open the home page at `/field-notes/` and view the source. The links look like this:

- 7 posts: things like `/posts/a-weekend-with-a-side-project`
- 4 tags: things like `/tag/opinion`
- the navigation bar: `/`, `/pages/about`, `/posts`
- plus `/rss.xml` and `/search`

None of them carries `/field-notes`. Click one and you leave your subpath and land under the root path.

The links come from two places, and they are fixed in different places:

1. **Hard-coded in the template code.** For example `` href={`/tag/${t.slug}`} `` in `src/pages/posts/[slug].astro`, and the `href="/posts"` that appears in several pages. These need to start with `import.meta.env.BASE_URL`.
2. **Stored in the database.** The three navigation items are not written in the template. They are menu data, stored in the `_emdash_menu_items` table, and their addresses are `/`, `/pages/about` and `/posts`. If you change only the template, the navigation bar does not move at all. You have to change the addresses of the menu items themselves, or change the seed file and load it again.

How these links are written in this template is the template's own choice. It is not a problem caused by the `base` setting. We also did not rewrite the whole template and then verify it, so all we can do here is tell you where to look. We cannot promise that everything is right once you have changed them.

## Addresses read by machines have no prefix either

Besides the links people see, there are three things read by machines, and we looked at those too:

- The addresses listed in `/sitemap.xml` look like `.../sitemap-posts.xml`, and the post addresses inside look like `.../posts/the-case-for-static`. None has `/field-notes`.
- Each item's `<link>` in the RSS feed is likewise `.../posts/...`.
- The root `/robots.txt` contains `Disallow: /_emdash/` and points to the sitemap, while `/field-notes/robots.txt` contains only `User-agent: *` and `Allow: /`, with neither the `/_emdash/` rule nor the sitemap.

The last point deserves some thought: search engines only read `robots.txt` at the root of the domain. The copy under the subpath is, in practice, read by nobody. If your main site is not EmDash, you have to block `/_emdash/` in the main site's `robots.txt` yourself.

Having no prefix in the sitemap and RSS means the addresses you submit to search engines will be addresses outside the subpath. We only observed the behavior. We did not trace which line of code decides it.

## Development mode will mislead you

We started by testing with `astro dev`, and this is what we got:

- `/_emdash/api/health` returned 500, with `Cannot read properties of undefined (reading 'registry')` in the log.
- `/sitemap.xml` returned 500, with the body `EmDash not configured`.

We thought `base` had broken the runtime. When we removed `base`, both addresses went back to 200, which convinced us even more.

Then we switched to running `astro build` first and starting with `node ./dist/server/entry.mjs`. With `base` set, both of those addresses return 200.

So do not use development mode to judge whether a subpath is configured correctly. We did not find out why the two modes differ.

## What we would click through by hand before going live

1. Build, start, and use curl to look at the source of the `/field-notes/` home page. Search for links that start with `href="/` but do not contain `/field-notes`.
2. Open `/_emdash/admin` and confirm that your front routing rule sends it to the application.
3. Take a look at the addresses in `sitemap.xml` and `rss.xml`.
4. Confirm that `/_emdash/` is blocked in the main site's `robots.txt`.
5. Visit `/` and `/posts`, and decide whether you want them to exist.

## What we did not test

- We did not put the front routing rule on a real Cloudflare Worker or nginx. The point above about sending both `/field-notes/*` and `/_emdash/*` is inferred from the behavior we observed.
- We did not try the Cloudflare adapter, only Node.
- We did not rewrite the links across the whole template.

If you can avoid a subpath and use a separate subdomain instead, you skip most of what this article covers.
