import { sanity } from "next-sanity/live/cache-life"; /** @type {import('next').NextConfig} */ const nextConfig = { cacheComponents: true, cacheLife: { default: sanity }, async redirects() { return [ { source: '/index', destination: '/', permanent: true, }, // Permanent 301 redirects for legacy blog URLs indexed by Google without /blog/ prefix { source: '/tai-sao-chon-viet-nam', destination: '/blog/tai-sao-chon-viet-nam', permanent: true, }, { source: '/vietnam-wedding-guide-part-1', destination: '/blog/vietnam-wedding-guide-part-1', permanent: true, }, { source: '/why-vietnam', destination: '/blog/why-vietnam', permanent: true, }, { source: '/wedding-framework-project-managment', destination: '/blog/wedding-framework-project-managment', permanent: true, }, { source: '/ngan-sach-tiec-cuoi-cao-cap-viet-nam-phan-1', destination: '/blog/ngan-sach-tiec-cuoi-cao-cap-viet-nam-phan-1', permanent: true, }, { source: '/ngan-sach-tiec-cuoi-cao-cap-viet-nam-phan-2', destination: '/blog/ngan-sach-tiec-cuoi-cao-cap-viet-nam-phan-2', permanent: true, }, { source: '/wedding-in-vietnam-questions', destination: '/blog/wedding-in-vietnam-questions', permanent: true, }, { source: '/chn-la-wedding-planner-ch-c-ph-hp-khng-c-tt-nht', destination: '/blog/chn-la-wedding-planner-ch-c-ph-hp-khng-c-tt-nht', permanent: true, }, ] }, async headers() { return [ { source: '/:path*', headers: [ { key: 'Content-Security-Policy', value: "frame-ancestors 'self' http://localhost:3333 http://127.0.0.1:3333 https://studio.weddinginvietnam.com https://*.sanity.studio https://*.sanity.build", }, ], }, ]; }, images: { formats: ["image/avif", "image/webp"], remotePatterns: [ { protocol: "https", hostname: "cdn.sanity.io", }, { protocol: "https", hostname: "fonts.googleapis.com", }, ], }, }; export default nextConfig;