10 lines
275 B
TypeScript
10 lines
275 B
TypeScript
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();
|
|
});
|