I am looking for a way to redirect joomla to a different page without changing the url in the address bar.
We currently have a site setup that when it encounters a 404 page (eg. site.com/fake-url) it redirects to a custom 404 page (site.com/404-page). This 404 page is an article page with custom modules etc. designed to help the user in finding the correct page.
However we now desire to keep the person on the incorrect url they entered and display the custom 404 page. I know it is possible via htaccess redirects to silently redirect without changing the url I am wondering if something like this is possible for joomla.
The current code that redirects is found in the templates error.php file
if($this->error->getCode() == "404"){
$link = JRoute::_("index.php?option=com_content&view=article&id=82&Itemid=163");
$app->redirect($link);
}