Как убрать в Joomla RSS код со всех страниц

rssИногда может мешать постоянное всовывание в каждую страницу кода RSS, Atom рассылок на Joomla. Эти строки порой странным образом появляются в поисковиках, и что более не приятно иногда вызывают ошибку 404. Но как же удалить из кода эти назойливые строки:

<link href="/feed/rss.html" rel="alternate" type="application/rss+xml" title="RSS 2.0" />
  <link href="/feed/atom.html" rel="alternate" type="application/atom+xml" title="Atom 1.0" />

 Для удаления этих строк из кода вам необходимо в файле libraries\joomla\document\feed\feed.php, найти и поменять эти строки:

function __construct ($options = array ())
{
parent::__construct ($options);
//set document type
$this->_type = 'feed';

на эти:

function __construct ($options = array ())
{
parent::__construct ($options);
JError::raiseError (404, JText::_('Resource Not Found'));

После чего эта проблема должна исчезнуть. В случае возникновения каких то неполадок, можете воспользоваться вторым путём решения этой задачи. Нужно в файлах:

\components\com_content\views\category\view.html.php

\components\com_content\views\categories\view.html.php

\components\com_content\views\article\view.html.php

\components\com_content\views\archive\view.html.php


Исправить строки:

if($params->get('show_feed_link', 1) == 1)
{
$link = '&format=feed&limitstart=';
$attribs = array('type' => 'application/rss+xml', 'title' => 'RSS 2.0');
$document->addHeadLink(JRoute::_($link.'&type=rss'), 'alternate', 'rel', $attribs);
$attribs = array('type' => 'application/atom+xml', 'title' => 'Atom 1.0');
$document->addHeadLink(JRoute::_($link.'&type=atom'), 'alternate', 'rel', $attribs);

На эти:

if($params->get('show_feed_link', 1) == 1)
{
$link = '&format=feed&limitstart=';
$attribs = array('type' => 'application/rss+xml', 'title' => 'RSS 2.0');
//$document->addHeadLink(JRoute::_($link.'&type=rss'), 'alternate', 'rel', $attribs);
$attribs = array('type' => 'application/atom+xml', 'title' => 'Atom 1.0');
//$document->addHeadLink(JRoute::_($link.'&type=atom'), 'alternate', 'rel', $attribs);

Как видите, добавлен двойной "/" в двух строках.


You have no rights to post comments

Карта сайта