I am creating a module which introduces a new Content Type for the pages.
In some cases I need the page with My Content Type to show error 404 (not found).
What is the best way to do it?
I would like to show the content of CMSMS built-in page with alias "error404", and at the same type to send http header status = 404 (not found).
I tried this:
Code: Select all
if( [condition not met] ){
$contentops =& $gCms->GetContentOperations();
$this->RedirectContent($contentops->GetPageIDFromAlias('error404'));
}
Maybe I should try something like this?
Code: Select all
if( [condition not met] ){
header("HTTP/1.0 404 Not Found");
[include the contents of error404 page]
die();
}
Or maybe there is another solution to my problem?