首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Joomla4致命错误重定向到我的旧网站?

Joomla4致命错误重定向到我的旧网站?
EN

Stack Overflow用户
提问于 2022-11-11 18:31:02
回答 1查看 14关注 0票数 0

这是我第一篇关于Stackoverflow的文章,但我已经关注你很长时间了。谢谢。我的问题很简单。在Joomla 4.2.5上发生致命错误后,可以重定向到我的旧站点。以下是system/attal.php上的文件。在接下来的代码行中,我想知道是否在某个地方添加了一个条件:

代码语言:javascript
复制
/**
 * @package     Joomla.Site
 * @subpackage  Template.system
 *
 * @copyright   (C) 2020 Open Source Matters, Inc. <https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

use Symfony\Component\ErrorHandler\ErrorRenderer\HtmlErrorRenderer;

/**
 * Note: This file is only used when unrecoverable errors happen,
 * normally at boot up stages, and therefore it cannot be assumed
 * that any part of Joomla is available (Eg: a Factory or application)
 *
 * For "normal" error handling, use error.php not this file.
 *
 * @var  HtmlErrorRenderer  $this       object containing charset
 * @var  string             $statusText exception error message
 * @var  string             $statusCode exception error code
 */

// Fallback template
$template = '{{statusCode_statusText}}';

// Joomla supplied fatal error page
if (file_exists(__DIR__ . '/fatal-error.html')) {
    $template = file_get_contents(__DIR__ . '/fatal-error.html');

**BY ADDIND A CONDITION HERE BUT I'M NOT SO SURE IF THIS WILL CONFLICTING WITH SOMETHING ELSE**

}

/**
 * User supplied fatal error page.

 *
 * Allow overriding Joomla supplied page to prevent changes being wiped on Joomla upgrade.
 * We allow it to be a PHP file so that any post-processing, alerting etc can happen.
 */
if (file_exists(__DIR__ . '/fatal-error.custom.php')) {
    require __DIR__ . '/fatal-error.custom.php';

    return;
}


I could redirect people to my old site?

Thank's reading me!


echo str_replace(
    ['{{statusCode_statusText}}', '{{statusCode}}', '{{statusText}}'],
    [$statusCode . ' - ' . $statusText, $statusCode, $statusText],
    $template
);
代码语言:javascript
复制
EN

回答 1

Stack Overflow用户

发布于 2022-11-12 00:49:58

我只是做了一个html元标记重定向到致命的-error.html文件,一切正常。我只是为这个愚蠢的问题感到尴尬。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/74406783

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档