Joomla 403重定向代码(Joomla 403 redirect code)

编程入门 行业动态 更新时间:2024-10-25 14:28:19
Joomla 403重定向代码(Joomla 403 redirect code)

当检测到403时,我遇到让Joomla 3将用户重定向到成员页面的问题。

经过几天的研究和尝试各种事情,我终于屈服于不得不提问。

从我的研究中我了解到Joomla从templates/system/error.php主文件中读取。

我在error.php实现了以下代码,我尝试强制它通过.htaccess也没有工作。

$ReferTo = $_SERVER['REQUEST_URI']; $ReferTo = base64_encode($ReferTo); if ($this->error->getCode() == '403') { header('Location: ' . $this->baseurl . '/members'); die(); }

目前的行为是Joomla只是将用户发送到一个非常无用的403默认页面。

关于这个的任何想法? 非常感谢您的帮助。

I have a problem with getting Joomla 3 to redirect users to a member page when a 403 is detected.

Upon researching and trying various things for literally days now I've finally given in to having to ask the question.

From my research I understand that the Joomla reads from the templates/system/error.php master file.

I have the following code implemented within the error.php and I have tried forcing it through .htaccess as well and neither work.

$ReferTo = $_SERVER['REQUEST_URI']; $ReferTo = base64_encode($ReferTo); if ($this->error->getCode() == '403') { header('Location: ' . $this->baseurl . '/members'); die(); }

The current behaviour is Joomla just sends the user to a very unhelpful 403 default page.

Any ideas on this one? Thanks so much for any help.

最满意答案

幸运的是,我设法找到了侥幸的解决方案。 我将系统文件夹error.php文件放入所有单独的模板文件夹中以创建系统覆盖。 到目前为止,Joomla已经认识到这一点。

Fortunately I have managed to find a solution by fluke. I dropped the system folder error.php file into all the individual template folders to create a system override. So far Joomla has recognised this.

更多推荐

Joomla,php,error,电脑培训,计算机培训,IT培训"/> <meta name="description&

本文发布于:2023-07-26 02:43:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1269943.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:重定向   代码   Joomla   redirect   code

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!