【发布时间】:2012-06-05 22:41:03
【问题描述】:
我一直在寻找一种方法来禁用提要链接(即:www.[websitename].com/?format=feed&type=rss)。
有没有办法禁用此链接?我有一些糟糕的谷歌索引,当谷歌再次尝试索引它们时,我想返回 404 not found。
【问题讨论】:
标签: joomla
我一直在寻找一种方法来禁用提要链接(即:www.[websitename].com/?format=feed&type=rss)。
有没有办法禁用此链接?我有一些糟糕的谷歌索引,当谷歌再次尝试索引它们时,我想返回 404 not found。
【问题讨论】:
标签: joomla
尝试编辑libraries/joomla/document/feed/feed.php 文件。
在文件中找到JFeedDocument类的__construct方法,修改如下:
function __construct($options = array()) {
JError::raiseError(404, JText::_('Resource Not Found'));
}
但是,在这种情况下,您根本没有“饲料”支持。
【讨论】:
以防万一有人在外面寻找这个,对我有用的是在 JDocumentFeed 构造函数中设置 404 Not Found 标头:
function __construct($options = array()) {
if (!headers_sent()) {
header('HTTP/1.0 404 Not Found');
//I guess you could include here a file to show the 404 page
}
exit();
}
JError::raiseError(404, JText::_('Resource Not Found')); 的调用给了我错误的回溯。
【讨论】: