I am working on a sitecore JSS Headless application that uses NextJS as front end.
I have 2 domains (domain1.com, domain2.com) created that shares the same code base.
404 page redirection auto refreshes every 3 seconds in my website.
Please do let me know if you need any additional details.
I’m using the below code to create 404 page. but my 404 page keeps refreshing.
404.tsx which is inside the pages folder:
import NotFound from 'src/NotFound';
const Custom404 = (): JSX.Element => <NotFound />;
export default Custom404;
NotFound.tsx:
import Head from 'next/head';
const NotFound = (): JSX.Element => (
<>
<Head>
<title>404: NotFound</title>
</Head>
<div style={{ padding: 10 }}>
<h1>Page not found</h1>
<p>This page does not exist.</p>
<a href="/">Go to the Home page</a>
</div>
</>
);
export default NotFound;
New contributor
SRK is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.