将500错误页面重定向到joomla中的其他页面

时间:2011-03-08 06:32:24

标签: joomla

我正在使用joomla 1.5,我正在使用500页面。但是我想将这些页面重定向到新页面这是可能的。下面我举了一个例子。

旧页面http://example.com/oldpag [500页错误页面]

我想将上述网址重定向到新的工作网页

新页面http://example.com/newpage

请告诉我..

此致 SurezRam

4 个答案:

答案 0 :(得分:3)

转到文件夹位置:yoursite / template / system /并修改error.php, 在defined( '_JEXEC' ) or die( 'Restricted access' );

之后添加以下重定向代码
header("location: http://example.com/newpage");
exit;

答案 1 :(得分:1)

如果您找不到一个创建一个,请将以下代码添加到joomla安装根目录中的 .htaccess 文件中。

# CUSTOM ERROR PAGES
 ErrorDocument 400 URL/error/403.shtml
 ErrorDocument 401 URL/error/403.shtml
 ErrorDocument 403 URL/error/403.shtml
 ErrorDocument 404 URL/error/404.shtml
 ErrorDocument 500 URL/error/500.shtml
# END CUSTOM ERROR PAGES

其中url是网站的网址。 我已相应地放置相应的错误文件。对于内部服务器错误[500],它将重定向到错误文件夹内的500.shtml文件。 Shtml只是带有重命名扩展名的html文件。

答案 2 :(得分:1)

您可以在joomla文档中使用该解决方案。这可用于任何错误代码。

http://docs.joomla.org/Creating_a_Custom_404_Error_Page

对于1.6我在这个stackoverflow问题上发布了一个修复:

How do I create a custom error page (404) for Joomla 1.6?

此解决方案对于kumarans解决方案也是必要的。

答案 3 :(得分:0)

感谢您的分享,我们也可以使用joomla redirect获取更多细节,您可以从这里获取

http://webobserve.blogspot.com/2011/03/redirect-error-page-to-some-other-page_09.html