# Next.js 410 Gone Status Feature This PR adds support for HTTP 410 Gone status in Next.js, providing developers with a way to indicate that content has been permanently removed. This is an important status code for SEO and user experience, as it differentiates between content that doesn't exist (404) and content that previously existed but has been deliberately removed (410). ## Features - New `gone()` function for App Router - Support for `gone: true` in getServerSideProps and getStaticProps for Pages Router - Custom `gone.js` file convention similar to `not-found.js` - Automatic noindex meta tags for Gone pages - Clear error messages for conflicting return values ## Implementation Details This PR implements: 1. **App Router Support**: - New `gone()` function in the `next/navigation` module - New `gone.js` file convention for customizing the 410 error page - Consistent behavior with other error handling patterns 2. **Pages Router Support**: - Added support for returning `{ gone: true }` from data fetching functions - Custom `/410` page support similar to `/404` page 3. **API Route Support**: - Guidance for returning 410 status from API routes ## Documentation - Added comprehensive documentation for the feature - Added examples for both App Router and Pages Router implementations - Added error documentation for invalid combinations (e.g., gone + redirect) ## Tests The PR includes: - Unit tests for the `gone()` function - Integration tests for Pages Router implementation - E2E tests for App Router implementation - Tests for browser navigation behavior - Error validation tests ## Example Usage ### App Router ```jsx import { gone } from 'next/navigation' export default function PostPage({ params }) { // Check if content has been deliberately removed if (isDeleted(params.slug)) { gone() // Returns 410 Gone status } // Continue rendering content... } ``` Pages Router ``` export async function getServerSideProps({ params }) { // Check if content has been deliberately removed if (isDeleted(params.id)) { return { gone: true } // Returns 410 Gone status } return { props: { /* ... */ } } } ``` ## Example Project An example project is included in `gone-status` demonstrating both App Router and Pages Router implementations of the feature. ## Breaking Changes None. This is a new feature with no changes to existing behavior. Fixes https://github.com/vercel/next.js/discussions/18684 Extends https://github.com/vercel/next.js/discussions/73753
This issue appears to be discussing a feature request or bug report related to the repository. Based on the content, it seems to be still under discussion. The issue was opened by Sam7 and has received 0 comments.