How do you make a custom 404 error page in Joomla! 4? Resolved


/* Load Custom 404 article with true 404 error code returned */
if ($this->error->getCode() == '404') {
     header("HTTP/1.0 404 Not Found");
     echo file_get_contents(JURI::root().'/404');
 exit;
 }
It should look something like this when your done...

/* Load Custom 404 article with true 404 error code returned */
if (($this->error->getCode()) == '404') {
	header('Location: ' . Jroute::_("index.php?option=com_content&view=article&id=44Itemid=462", false));
	exit;
}
#38Edited 5 months ago

You must be logged in to post an answer

Sorry, this website uses features that your browser doesn’t support. Upgrade to a newer version of Firefox, Chrome, Safari, or Edge and you’ll be all set.