How to fix the read more links, in Joomla RSS Feeds

Written on . Posted in .

The problem is that in the default Joomla RSS feed, can’t get the full urls, and returns 404 error links from 3rd party RSS readers like feedly, feedburner etc.

For example:

ERROR READ MORE LINK => “/latest-news/62-demo-article.html”

THE CORRECT MUST BE: => “http://www.mydomain.com/latest-news/62-demo-article.html”

HOW TO FIX IT:

STEP 1.

Open the file: “/components/com_content/views/featured/view.feed.php”, lines ~98.

Find:

$description .= '<p class="feed-readmore"><a target="_blank" href ="' . $item->link . '">' . JText::_('COM_CONTENT_FEED_READMORE') . '</a></p>';

Replace with:

$new_base_url = JURI::base();
$new_base_url = preg_replace('//$/', '', $new_base_url);
$new_full_link = $new_base_url.$item->link;
$description .= '<p class="feed-readmore"><a target="_blank" href ="' . $new_full_link . '">' . JText::_('COM_CONTENT_FEED_READMORE') . '</a></p>';

STEP 2.

Open the file: “/components/com_content/views/category/view.feed.php”, lines ~51.

Find:

$item->description .= '<p class="feed-readmore"><a target="_blank" href ="' . $link . '">' . JText::_('COM_CONTENT_FEED_READMORE') . '</a></p>';

Replace with:

$new_base_url = JURI::base();
$new_base_url = preg_replace('//$/', '', $new_base_url);
$new_full_link = $new_base_url.$link;
$item->description .= '<p class="feed-readmore"><a target="_blank" href ="' . $new_full_link . '">' . JText::_('COM_CONTENT_FEED_READMORE') . '</a></p>';

Do not keep in mind the above solution if you do not use the “Read more” separator button in your articles.

If you have any further questions or any difficulties with the suggested solution above, feel free to contact us or leave a comment in form below.