How do I create a custom error page (404) for Joomla 1.6?(如何为 Joomla 1.6 创建自定义错误页面 (404)?)
问题描述
如何为 Joomla 1.6 创建自定义错误页面 (404)?
How do I create a custom error page (404) for Joomla 1.6?
我尝试了一个教程 (http://docs.joomla.org/Tutorial:Create_a_Custom_404_Error_Page),但它适用于 1.5,但它不起作用.
I've tried a tutorial (http://docs.joomla.org/Tutorial:Create_a_Custom_404_Error_Page) but it's for 1.5 and it's not working.
谢谢.
推荐答案
对 ->code 的调用是对受保护属性的调用,也就是不再可能.您必须使用 getCode().1.6 的固定代码:
The call to ->code is a call to a protected property, aka not possible any more. You have to use getCode(). The fixed code for 1.6 :
if ($this->error->getCode() == '404') {
header('Location: /index.php?option=com_content&view=article&id=214');
exit;
} ;
这现在适用于 Yoomla 1.6.(作为对 http://docs.joomla.org/Creating_a_Custom_404_Error_Page 上的 1.5 示例的修复 - 其余的此页面上是准确的)
This works for Yoomla 1.6 now. ( as a fix for the 1.5 example on http://docs.joomla.org/Creating_a_Custom_404_Error_Page - the rest on this page is accurate)
这篇关于如何为 Joomla 1.6 创建自定义错误页面 (404)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何为 Joomla 1.6 创建自定义错误页面 (404)?
基础教程推荐
- YouTube API v3 点赞视频,但计数器不增加 2022-01-01
- 在PHP中根据W3C规范Unicode 2022-01-01
- 如何在 Laravel 5.3 注册中添加动态下拉列表列? 2021-01-01
- PHP 类:全局变量作为类中的属性 2021-01-01
- PHP PDO MySQL 查询 LIKE ->多个关键词 2021-01-01
- 学说 dbal querybuilder 作为准备好的语句 2022-01-01
- 如何在 Laravel 中使用 React Router? 2022-01-01
- Cron Jobs 调用带有变量的 PHP 脚本 2022-01-01
- 如何替换eregi() 2022-01-01
- 有什么方法可以用编码 UTF-8 而不是 Unicode 返回 PHP`json_encode`? 2021-01-01
