defined('_JEXEC') or die; use Joomla\CMS\Factory; $app = Factory::getApplication(); $app->redirect('/error-404.html', 404);