From 912b9e5d2cd041fd4f06f4ffd2e8e7c9ba526f98 Mon Sep 17 00:00:00 2001 From: Hamza Rashid Date: Mon, 18 Nov 2024 22:43:43 +0000 Subject: [PATCH] Update next.config.js --- next.config.js | 32 +++++++++++++------------------- 1 file changed, 13 insertions(+), 19 deletions(-) diff --git a/next.config.js b/next.config.js index 8809504..24ccdf0 100644 --- a/next.config.js +++ b/next.config.js @@ -1,32 +1,26 @@ /** @type {import('next').NextConfig} */ const nextConfig = { - trailingSlash: true, // Ensures that URLs have a trailing slash + trailingSlash: true, async rewrites() { - return [ + return [ { - source: "/blog/:path*/", // Handles trailing slash versions - destination: "https://gcse-doctor.ghost.io/blog/:path*/", + source: "/blog/:path*/", + destination: "https://articles.ghost.io/blog/:path*/", }, { - source: "/blog/:path*", // Handles non-trailing slash versions - destination: "https://gcse-doctor.ghost.io/blog/:path*", - }, + source: "/blog/:path*", + destination: "https://articles.ghost.io/blog/:path*", + } ]; }, async headers() { return [ { - source: "/blog/:path*", // Adds custom headers to blog requests - headers: [ - { - key: "x-forwarded-host", - value: "articles.gcsedoctor.co.uk", // Replace with your desired subdomain - }, - ], - }, + source: "/blog/:path*", + headers: [{ key: "x-forwarded-host", value: "gcsedoctor.co.uk" }], + } ]; - }, - }; + } + } - module.exports = nextConfig; - \ No newline at end of file + module.exports = nextConfig \ No newline at end of file