• Hi,

    I am running a site that routinely has posts that expire and thus no longer exist. So I need a good 404 page.

    Is it possible to include the expired page’s title dynamically (using variables) into the 404 page?

    For example, if an expired post was titled “2007 Is a Great Year” and someone ends up at http://some-domain-name.com/2007-is-a-great-year/ they will get a 404 page.

    I would like to put the “2007 Is a Great Year” between <h1></h1> and make it part of the 404 page. Instead of, for instance, “Page Not Found”

    If possible, how do I do this? What variable do I use?

    Thanks for any help. I hope this made sense and is not too convoluted.

Viewing 1 replies (of 1 total)
  • $_SERVER['REQUEST_URI'] should give you the url that the user requested but if the page has been deleted from the database, there’s no way to finding out it’s original title. The best I think you can do is to try and extract the last part of the request url and try to build a human-readable pseudo-title from that.

Viewing 1 replies (of 1 total)

The topic ‘404 Customizing’ is closed to new replies.