简体   繁体   中英

Joomla Template - Helix framework - error.php

I have a Joomla Template that uses the Helix framework (Two | Responsive & Multipurpose Template ). The Template has an error.php and all errors are forwarded to a special error page. Now I want to realize, that all 401 errror are forwarded to the login page. I used this code:

$error   = $this->error->getCode();
// redirect 401 messages to login
if ($error == '401') {
    header('Location: index.php?option=com_users&view=login');
    exit;
}

But Joomla ignores my changes. Do I have to edit another file? Thanks in advance

Below is an example of how to trap a 404 error and provide a custom message.

<?php  if ($this->error->getCode() == '404') { ?>
    header('Location: index.php?option=com_users&view=login');
    exit;
<?php } ?>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM