feat: redirection
This commit is contained in:
parent
45760405be
commit
e748e2a648
|
|
@ -128,6 +128,31 @@ module.exports = withSentryConfig(
|
|||
]
|
||||
},
|
||||
staticPageGenerationTimeout: 3600,
|
||||
|
||||
async redirects() {
|
||||
return [
|
||||
{
|
||||
source: "/sitemap.txt",
|
||||
destination: "/sitemap.xml",
|
||||
permanent: true,
|
||||
},
|
||||
{
|
||||
source: "/sitemap.xml.gz",
|
||||
destination: "/sitemap.xml",
|
||||
permanent: true,
|
||||
},
|
||||
{
|
||||
source: "/sitemap_index.xml",
|
||||
destination: "/sitemap.xml",
|
||||
permanent: true,
|
||||
},
|
||||
{
|
||||
source: "/sitemaps.xml",
|
||||
destination: "/sitemap.xml",
|
||||
permanent: true,
|
||||
},
|
||||
]
|
||||
},
|
||||
}),
|
||||
),
|
||||
{
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ export const GET = async (req: NextRequest) => {
|
|||
type: "post",
|
||||
visibility: PageVisibilityEnum.Published,
|
||||
limit: 1000,
|
||||
skipExpansion: true,
|
||||
},
|
||||
queryClient,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ export default async function middleware(req: NextRequest) {
|
|||
return NextResponse.redirect(`https://${req.headers.get("host")}/feed`, 301)
|
||||
}
|
||||
|
||||
console.debug(`${req.method} ${req.nextUrl.pathname}${req.nextUrl.search}`)
|
||||
console.debug(`${req.method} ${req.nextUrl}`)
|
||||
|
||||
if (
|
||||
pathname.startsWith("/api/") ||
|
||||
|
|
@ -54,7 +54,9 @@ export default async function middleware(req: NextRequest) {
|
|||
pathname.startsWith("/locales/") ||
|
||||
pathname.match(/^\/(workbox|worker|fallback)-\w+\.js(\.map)?$/) ||
|
||||
pathname === "/sw.js" ||
|
||||
pathname === "/sw.js.map"
|
||||
pathname === "/sw.js.map" ||
|
||||
pathname === "/monitoring" ||
|
||||
pathname === "favicon.ico"
|
||||
) {
|
||||
return NextResponse.next()
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue