Q:

Custom 404 page shows unselected modules

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. 

A:

Change 
JURI::root().'index.php?/es-co/option=com_content&view=article&id=23'

to 
JURI::root().'?option=com_content&view=article&id=23'

Reason:
JURI::root().'index.php?/es-co/option=com_content&view=article&id=23'

is being routed to (try it in your browser):
http://example.com/es-co/?/es-co/option=com_content&view=article&id=23
Which is loading that article, but routed through the homepage's menu item, so it'll load the article using the homepage's layout.
Making the suggested change will load the 404 article in the menu you had created for it.

