简体   繁体   English

Joomla模板-Helix框架-error.php

[英]Joomla Template - Helix framework - error.php

I have a Joomla Template that uses the Helix framework (Two | Responsive & Multipurpose Template ). 我有一个使用Helix框架的Joomla模板(两个|响应式和多用途模板)。 The Template has an error.php and all errors are forwarded to a special error page. 模板具有error.php,所有错误均转发到特殊的错误页面。 Now I want to realize, that all 401 errror are forwarded to the login page. 现在,我想意识到,所有401错误都会转发到登录页面。 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. 但是Joomla忽略了我的更改。 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. 以下是如何捕获404错误并提供自定义消息的示例。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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