KuafuSoft you are the best!!
For some reason in my install (I have patched it with some of the magento patches though?) the _processRedirectOptions() looks like this :
protected function _processRedirectOptions()
{
$isPermanentRedirectOption = $this->_rewrite->hasOption('RP');
$external = substr($this->_rewrite->getTargetPath(), 0, 6);
if ($external === 'http:/' || $external === 'https:') {
$destinationStoreCode = $this->_app->getStore($this->_rewrite->getStoreId())->getCode();
$this->_setStoreCodeCookie($destinationStoreCode);
$this->_sendRedirectHeaders($this->_rewrite->getTargetPath(), $isPermanentRedirectOption);
}
$targetUrl = $this->_request->getBaseUrl() . '/' . $this->_rewrite->getTargetPath();
$storeCode = $this->_app->getStore()->getCode();
if (Mage::getStoreConfig('web/url/use_store') && !empty($storeCode)) {
$targetUrl = $this->_request->getBaseUrl() . '/' . $storeCode . '/' . $this->_rewrite->getTargetPath();
}
if ($this->_rewrite->hasOption('R') || $isPermanentRedirectOption) {
$this->_sendRedirectHeaders($targetUrl, $isPermanentRedirectOption);
}
$queryString = $this->_getQueryString();
if ($queryString) {
$targetUrl .= '?' . $queryString;
}
$this->_request->setRequestUri($targetUrl);
$this->_request->setPathInfo($this->_rewrite->getTargetPath());
return $this;
}
So you can see the $queryString code fix in the file procedure.
But you are right - it was not in the correct place!
So I've moved it to that place and now it works.
Thank you again!!