feat: redirect feed.xml and atom.xml

This commit is contained in:
DIYgod
2023-03-06 01:05:24 +00:00
parent 10b71cf644
commit 11fc759533
2 changed files with 8 additions and 0 deletions
+1
View File
@@ -11,6 +11,7 @@ const slugReservedWords = [
"nft",
"sw.js",
"manifest.json",
"atom.xml",
]
export const checkSlugReservedWords = (word: string) => {
+7
View File
@@ -24,6 +24,13 @@ export default async function middleware(req: NextRequest) {
}
}
if (pathname === "/feed.xml" || pathname === "/atom.xml") {
return NextResponse.redirect(
`https://${req.headers.get("host")}/feed/xml`,
301,
)
}
console.log(`${req.method} ${req.nextUrl.pathname}${req.nextUrl.search}`)
if (