Tutorial: Customized "404: Not Found"-page

Creating your own 404 error page with phenotype is pretty straight forward.

Here’s an even more flexible solution:

  • Create a new page within a pagegroup that is not linked to the menu by default.
  • Assign '404-not-found’ as smartURL to that page.
  • Edit the contents of that page as you see fit.

Now, in your “_application.inc.php” within your class PhenotypeApplication overwrite the throw404()-function, adding a header redirect to your own 404 page:

<?php
class PhenotypeApplication extends PhenotypeApplicationStandard
{
 
  ...
  ...
 
  function throw404($pag_id)
  {
    Header("HTTP/1.0 404 Not Found");
    Header("Location: /404-not-found");
  }
}

You think Phenotype Wiki/Documentation could be better?
We too. Please contribute: Edit this page

Bookmark and Share