I thought there was a hook_page_not_found() but I'm wrong.

I have a list of nodes that I want to end of life. They should be replaced by a 410 Gone status and common text explaining our end of life policy. In other words, I don't want to just unpublish them and let the 404 page show up.

I don't want to impose a burden on every page load, which is why I wanted to tap into page not found.

Is there a way to do this?




N1ghteyes’s picture

im not sure about forcing a 410.. but you can specify custom 404 pages...

no reason you couldnt do something like this:

Add a checkbox to nodes
when unpublishing for the nodes in question, make sure this box is checked
Custom 404 page checks the node attempted, if said node has the checkbox set, display a given messege, otherwise display default.

A simple custom module can do that :)