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)?


基础教程推荐
- WooCommerce 中选定产品类别的自定义产品价格后缀 2021-01-01
- 超薄框架REST服务两次获得输出 2022-01-01
- Libpuzzle 索引数百万张图片? 2022-01-01
- 在 PHP 中强制下载文件 - 在 Joomla 框架内 2022-01-01
- 通过 PHP SoapClient 请求发送原始 XML 2021-01-01
- 在 Woocommerce 中根据运输方式和付款方式添加费用 2021-01-01
- 如何在 PHP 中的请求之间持久化对象 2022-01-01
- XAMPP 服务器不加载 CSS 文件 2022-01-01
- mysqli_insert_id 是否有可能在高流量应用程序中返回 2021-01-01
- 在多维数组中查找最大值 2021-01-01