diff options
| author | Yasutake Yohei <61961825+yasutakeyohei@users.noreply.github.com> | 2026-11-05 14:17:54 +0900 |
|---|---|---|
| committer | Yasutake Yohei <61961825+yasutakeyohei@users.noreply.github.com> | 2026-11-05 14:17:54 +0900 |
| commit | fd377d1df26df4643f8028677b027327d397f121 (patch) | |
| tree | ba5a9556d5c174916075f0fa5f4c3ac772624242 /astro.config.mjs | |
| parent | c43be8eb6718ad4c3019fe150ed395e8c73abf2d (diff) | |
events: 旧URLの転送をAstro側にも定義
.htaccessは本番のApacheでしか効かず、astro devでは旧URLが404に
なっていた。config の redirects と動的ルートで同じ301転送を用意した。
Diffstat (limited to 'astro.config.mjs')
| -rw-r--r-- | astro.config.mjs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/astro.config.mjs b/astro.config.mjs index 03c5b9e..6b6406b 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -87,6 +87,13 @@ export default defineConfig({ base: "/", trailingSlash: "always", compressHTML: true, + // 旧URLからの転送。本番は .htaccess が301で返すが、astro dev / preview では + // .htaccess が効かないため、ここでも同じ転送を定義しておく。 + redirects: { + "/kodaira-data/hp-archive/schedule": "/kodaira/events/", + "/kodaira-data/schedule": "/kodaira/events/", + "/kodaira-data/events": "/kodaira/events/", + }, image: { layout: "constrained", responsiveStyles: true, |
