summaryrefslogtreecommitdiff
path: root/.changeset/blue-pens-divide.md
blob: a295fe7b1494798d9dbedc7c00ae1915863153aa (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
---
'astro': patch
---

Fixes a bug in the logic of `Astro.rewrite()` which led to the value for `base`, if configured, being automatically prepended to the rewrite URL passed. This was unintended behavior and has been corrected, and Astro now processes the URLs exactly as passed.

If you use the `rewrite()` function on a project that has `base` configured, you must now prepend the base to your existing rewrite URL:

```js
// astro.config.mjs
export default defineConfig({
  base: '/blog'
})
```

```diff
// src/middleware.js
export function onRequest(ctx, next) {
-  return ctx.rewrite("/about")
+  return ctx.rewrite("/blog/about")
}
```