import { defineMiddleware } from 'astro:middleware'; export const onRequest = defineMiddleware(async (context, next) => { // Only redirect if we're at the root path if (context.url.pathname === '/') { return context.redirect('/en', 301); } return next(); });