Skip to content

Returning HTTP status 410 Gone for particular paths #18684

Answered by Sam7
jnv asked this question in Help
Discussion options

You must be logged in to vote

We have the very same need here.

I created a PR to add a Gone() option that works analogously to NotFound()
#78706

  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 …

Replies: 6 comments 12 replies

Comment options

You must be logged in to vote
2 replies
@fasani-tx
Comment options

@bryanrasmussen
Comment options

Comment options

You must be logged in to vote
4 replies
@jnv
Comment options

@yassinebridi
Comment options

@Kyoss79
Comment options

@codewithPoppy
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@jnv
Comment options

Comment options

You must be logged in to vote
5 replies
@abid-salahi
Comment options

@marjorg
Comment options

@bugignat
Comment options

@uglyrobot
Comment options

@alexanderbnelson
Comment options

Answer selected by jnv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet