How do I get sef friendly urls in a Joomla Feed
For months now I've been wondering why search engines keep getting raw (non opensef) links to my sites pages, finally realized it was coming from my RSS which isn't using the sef urls. Could I manually alter the rss output to fix this?
Joomla 1.0 opensef (which is no longer available site is gone)
in

Replies
altering rss.php
In - /components/com_rss/rss.php line 264 or so the link is set in $item_link
$item_link = 'index.php?option=com_content&task=view&id='. $row->id . $_Itemid;
$item_link = sefRelToAbs( $item_link );
//added by me to make rss urls opensef
$opensql = "select external from jos_opensef_sef where internal like('%&id={$row->id}&%')";
$database->setQuery( $opensql, 0, 1 );
$urlrows = $database->loadObjectList();
foreach( $urlrows as $urlrow){
$item_link = 'http://full-domain-name.com' . $urlrow->external;
}
Since opensef doesn't store a direct connection to between the opensef url and the non I'm just querying for the internal link that has the ID from $row->id and limiting it to 1 result as there will be 2 or 3 entries for that id but all end up with the same friendly url.
make a copy of rss.php before editing just in case, turn off caching on the rss while working on it or you won't see any changes or possible problems.
Post new comment