如何为Joomla 1.6创建自定义错误页面(404)? [英] How do I create a custom error page (404) for Joomla 1.6?

查看:152
本文介绍了如何为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)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆