Open taiga533 opened 5 months ago
Sounds reasonable, but I would expect a status code redirect still if output: 'server'
. Would you be willing to implement this?
I was facing something similar. No redirects working, unless the output is set to server
(example CodeSandbox).
import { defineConfig } from "astro/config";
const output = "hybrid"; // Doesn't work, if set to hybrid or static.
// const output = "server"; // But works as expected if set to server.
const redirects = {
"/old": "/new",
};
export default defineConfig({
output,
redirects,
});
Or if this is the expected behavior, maybe it could be mentioned in the redirect docs
Unless I'm just being silly and missing something really obvious(?)
I'd be willing to take a look at submitting a PR, if someone could point me in the right direction.
Astro Info
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
"When using the development server versus distributing static build artifacts, the behavior of redirects differs.
With the following configuration, on the development server, the contents of old-page.astro (old-page/index.html) are displayed, but when a static build is performed and distributed on any server (or previewed using astro preview), old-page/index.html is displayed and then redirected to new-page.astro using the
<meta http-equiv=\"refresh\">
tag.What's the expected result?
I believe that even on the development server, old-page.astro should be displayed and then redirected to new-page.astro using the <meta http-equiv=\"refresh\"> tag.
Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-yogmzg?file=astro.config.mjs
Participation