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

查看:22
本文介绍了如何为 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天全站免登陆