Computer Programming/Next
2023. 8. 2.
Next.js 13 - Redirects, Rewrites, Middleware, .env
1. Redirects ์ญ์ ๋ ํ์ด์ง, ์กด์ฌํ์ง ์๋ ํ์ด์ง์ผ ๊ฒฝ์ฐ ์ง์ ํ ๊ฒฝ๋ก๋ก ๋ฆฌ๋ค์ด๋ ํธ ์ํด next.config.js์์ ์ค์ ํจ /** @type {import('next').NextConfig} */ const nextConfig = { images: { remotePatterns: [ { protocol: "https", hostname: "images.unsplash.com", }, ], }, async redirects() { return [ { source: "/products/deleted_forever", destination: "/products", permanent: true, //search engine์๊ฒ ํ์ฌ ํ์ด์ง๋ ์กด์ฌํ์ง ์๋๋ค๊ณ ์๋ ค์ค -> ์บ์ฑ }, { source:..