aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorYasutake Yohei <61961825+yasutakeyohei@users.noreply.github.com>2026-11-05 14:17:54 +0900
committerYasutake Yohei <61961825+yasutakeyohei@users.noreply.github.com>2026-11-05 14:17:54 +0900
commitfd377d1df26df4643f8028677b027327d397f121 (patch)
treeba5a9556d5c174916075f0fa5f4c3ac772624242 /src
parentc43be8eb6718ad4c3019fe150ed395e8c73abf2d (diff)
events: 旧URLの転送をAstro側にも定義
.htaccessは本番のApacheでしか効かず、astro devでは旧URLが404に なっていた。config の redirects と動的ルートで同じ301転送を用意した。
Diffstat (limited to 'src')
-rw-r--r--src/pages/kodaira-data/events/[...path].astro13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/pages/kodaira-data/events/[...path].astro b/src/pages/kodaira-data/events/[...path].astro
new file mode 100644
index 0000000..e09cc30
--- /dev/null
+++ b/src/pages/kodaira-data/events/[...path].astro
@@ -0,0 +1,13 @@
+---
+// 旧URL(/kodaira-data/events/2026-11/ など)から新しいURLへの転送。
+// 本番のApacheは public/.htaccess が301で返す。astro dev / preview では
+// .htaccess が効かないため、ここで同じ転送を用意しておく。
+import { fiscalYearKeys, monthKeys } from '@/lib/schedule-months';
+
+export function getStaticPaths() {
+ return [...monthKeys, ...fiscalYearKeys].map((path) => ({ params: { path } }));
+}
+
+const { path } = Astro.params;
+return Astro.redirect(`/kodaira/events/${path}/`, 301);
+---