we are running a Magento 1.4.2.0 Webshop with google analytics. As we all know google attaches a querystring called the \"gclid-Param\" to the url.
The customer clicks t
After some more deep research inside the chaos of magento we found the solution to solve our Problem.
In the Url-Model of the Mage_Core exists a class rewrite.php. We created a custom model and overwrited the rewrite.php.
Inside of the function rewrite(), we added the following piece(marked as comments) of code:
//$url_params = false;
//if ($url_params = $_SERVER['QUERY_STRING'])
//$url_params = "?".$url_params;
if ($external === 'http:/' || $external === 'https:')
{
if ($isPermanentRedirectOption)
{
header('HTTP/1.1 301 Moved Permanently');
}
header("Location: ".$this->getTargetPath() //.$url_params);
exit;
}
else
{
$targetUrl = $request->getBaseUrl(). '/' . $this->getTargetPath();
}
$isRedirectOption = $this->hasOption('R');
if ($isRedirectOption || $isPermanentRedirectOption)
{
if (Mage::getStoreConfig('web/url/use_store') && $storeCode =
Mage::app()->getStore()->getCode())
{
$targetUrl = $request->getBaseUrl(). '/' . $storeCode . '/'
.$this->getTargetPath();
}
if ($isPermanentRedirectOption)
{
header('HTTP/1.1 301 Moved Permanently');
}
header('Location: '.$targetUrl //.$url_params);
exit;
}
So i hope our solution helps others, who are facing the same problem.
Best regards Markus