php #Joomla自定义404页面。

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了php #Joomla自定义404页面。相关的知识,希望对你有一定的参考价值。

<?php
/**
* Custom error page
*/

defined('_JEXEC') or die;

if ($this->error->getCode() == '404') {
     header("HTTP/1.0 404 Not Found");
     echo file_get_contents(JURI::root().'error-404');
   exit;
}

// if($this->error->getCode()=='404') {

// 	header("HTTP/1.0 404 Not Found");
// 	header('Location: index.php?option=com_content&view=article&id=231');
// 	exit;
// }

?>

以上是关于php #Joomla自定义404页面。的主要内容,如果未能解决你的问题,请参考以下文章

尝试在 Joomla 中使用自定义组件时找不到 404 组件

在文章中提交 PHP 表单时出现 Joomla 2.5 404 错误

自定义 404 错误页面——仅适用于 PHP 页面

PHP中的自定义404错误页面

如何更改Joomla的网址!登录模块到我们的自定义页面?

php Codeigniter自定义控制器基础404页面