Skip to content

Commit

Permalink
Update next.config.js
Browse files Browse the repository at this point in the history
  • Loading branch information
hamza-rashid committed Nov 18, 2024
1 parent b224cd7 commit 912b9e5
Showing 1 changed file with 13 additions and 19 deletions.
32 changes: 13 additions & 19 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -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;

module.exports = nextConfig

0 comments on commit 912b9e5

Please sign in to comment.