I want to use a custom 404 page for my website, so I followed the directions I found here and here.
However, when I trigger an error, the 404 message is embedded in the middle of my homepage, i.e., I see all modules assigned to it, and the message is right in the middle, where articles (and Joomla messages) would normally go.
The code I added to the top of the error.php file is as follows:
defined('_JEXEC') or die;
if (($this->error->getCode()) == '404') {
header("HTTP/1.0 404 Not Found");
echo file_get_contents(JURI::root().'index.php?/es-co/option=com_content&view=article&id=23');
exit(0);
}
I only use those modules on the frontpage, and the menu I got the link from, is enabled but not assigned to any module.
What am I doing wrong?
You can take a look here.