Created on 26 June 2024, 2 months ago

Problem/Motivation

If we delete a page or a file and do not intentionally redirect to some other page or file, the website visitor gets a 404 Not Found response. However, if the website visitor had previously viewed this content and was expecting to see it, this could be confusing. It would be better to deliver them to a 410 Gone page and send a 410 status code, allowing us to provide a meaningful explanation to the site visitor as to what has happened. For example, that we are intentionally removing content that is older than our retention period, and providing a link to the retention policy. This also instructs search engines to remove the page or file from their database.

Steps to reproduce

1. Delete a page
2. Attempt to visit the page

Expected result: View a 410 Gone page and receive a 410 status code.
Actual result: View a 404 Not Found page and receive a 404 status code.

3. Delete a file
4. Attempt to visit the file

Expected result: View a 410 Gone page and receive a 410 status code.
Actual result: View a 404 Not Found page and receive a 404 status code.

The following additional steps require the Redirect module:

5. Delete a page
6. Create a redirect to another page
7. Attempt to visit the page

Expected and actual results: View the replacement page.

8. Delete a file
9. Create a redirect to another file
10. Attempt to visit the file

Expected and actual results: View the replacement file.

Proposed resolution

Add support for the 410 Gone service code:

/admin/config/system/site-information
In the error codes Field group, add support for a 410 Gone page.

Add a database table which tracks pages and files that have been deleted.

Add the following logic (pseudocode) for pages or files which are requested but do not exist:

If the requested URL has a redirect
  Do the redirect
Else if the page is in the Gone list
  Deliver the 410 Gone page and a 410 status code
Else
  Deliver the 404 Not Found page and a 404 status code
End if

Remaining tasks

User interface changes

Optional: Checkbox to enable support for 410 Gone

If 410 Gone support is enabled, whether for all sites or only for those sites who opt into it:

/admin/config/system/site-information
Under error pages:

  • Change the instruction for 404 to read "This page is displayed when no other content matches the requested document and the content never existed. Leave blank to display a generic "page not found" page."
  • Add an input field with the label "Default 410 (gone) page" and the instruction "This page is displayed when no other content matches the requested document and the content previously existed but has been deleted. Leave blank to display a generic "gone" page."

API changes

Data model changes

Release notes snippet

✨ Feature request
Status

Active

Version

11.0 πŸ”₯

Component
Request processingΒ  β†’

Last updated 6 days ago

No maintainer
Created by

πŸ‡ΊπŸ‡ΈUnited States Charles Belov San Francisco, CA, US

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024