feat: redirect feed.xml and atom.xml
This commit is contained in:
@@ -11,6 +11,7 @@ const slugReservedWords = [
|
||||
"nft",
|
||||
"sw.js",
|
||||
"manifest.json",
|
||||
"atom.xml",
|
||||
]
|
||||
|
||||
export const checkSlugReservedWords = (word: string) => {
|
||||
|
||||
@@ -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 (
|
||||
|
||||
Reference in New Issue
Block a user