I debugged the problem and it turns out that when internal redirecting a page through mod_rewrite, QUERY_STRING is updated but REQUEST_URI stays like the old url.
To hotfix the problem I changed components/com_sef/joomsef.php:
function parse(&$uri)
{
global $mainframe;
// test for the backlink plugin to work correctly
if (JPluginHelper::isEnabled('system', 'backlink')) {
$joomlaRequest = $_SERVER['REQUEST_URI'];
$realRequest = $uri->toString(array('path', 'query'));
if ($realRequest != $joomlaRequest) {
$uri = new JURI($joomlaRequest);
}
}
+ if (!empty($_SERVER['QUERY_STRING']))
+ {
+ $uri->_query .= (!empty($uri->_query) ? '&' : '').$_SERVER['QUERY_STRING'];
+ }
Probably the redirect detection should be made prior to this function and in other parts of the code, but this just worked for me. How can I suggest this to enter the mainstream as a mod_rewrite compatibility fix?
Thanks.