Here’s how to create the nextjs app
npx create-next-app@latest
Edit the next.config.ts
const nextConfig: NextConfig = {
async redirects() {
return [
{
source: "/:path*",
destination: "https://domainname.com/:path*",
permanent: true,
},
];
},
};
The file will look like the below originally:
import type { NextConfig } from "next";
const nextConfig: NextConfig = {
/* config options here */
};
export default nextConfig;
Have any questions or comments? Write them below!