Returning http 410 in header
Unanswered
Bee posted this in #help-forum
BeeOP
Hey guys I need some help.
import Link from "next/link"
const NotFoundPage = () => {
return (
<div className="flex mt-52 flex-col items-center justify-center min-h-[500px] ">
<h1 className="text-4xl font-semibold text-gray-300">
Oops! Page not found
</h1>
<p className="mt-2 text-gray-300">
The page you are looking for might have been removed or is temporarily
unavailable.
</p>
<Link href="/" className="mt-4 text-orange-600 hover:underline">
Go back to home
</Link>
</div>
)
}
export default NotFoundPage
This is my not found page and this is how i am returnin 404 error on pages that are not present
const getContent = async (slug) => {
const contentJson = contentData.find((content) => content.slug === slug);
if (!contentJson) {
return notFound();
} else {
try {
const { slug } = contentJson;
const Mymodule = await import(../../content/${slug});
const ContentComponent = Mymodule.default;
return <ContentComponent />;
} catch (error) {
return notFound();
}
}
};
I want to return 410 error in response instead of 404. Is there any way i can do it?
import Link from "next/link"
const NotFoundPage = () => {
return (
<div className="flex mt-52 flex-col items-center justify-center min-h-[500px] ">
<h1 className="text-4xl font-semibold text-gray-300">
Oops! Page not found
</h1>
<p className="mt-2 text-gray-300">
The page you are looking for might have been removed or is temporarily
unavailable.
</p>
<Link href="/" className="mt-4 text-orange-600 hover:underline">
Go back to home
</Link>
</div>
)
}
export default NotFoundPage
This is my not found page and this is how i am returnin 404 error on pages that are not present
const getContent = async (slug) => {
const contentJson = contentData.find((content) => content.slug === slug);
if (!contentJson) {
return notFound();
} else {
try {
const { slug } = contentJson;
const Mymodule = await import(../../content/${slug});
const ContentComponent = Mymodule.default;
return <ContentComponent />;
} catch (error) {
return notFound();
}
}
};
I want to return 410 error in response instead of 404. Is there any way i can do it?