// code was ignoring the case where no canonical redirection is wanted

parent bd51e5fe
...@@ -418,10 +418,16 @@ class ShopCore extends ObjectModel ...@@ -418,10 +418,16 @@ class ShopCore extends ObjectModel
if (count($params)) if (count($params))
$url .= '?'.http_build_query($params); $url .= '?'.http_build_query($params);
} }
$redirect_type = Configuration::get('PS_CANONICAL_REDIRECT') == 2 ? '301' : '302';
header('HTTP/1.0 '.$redirect_type.' Moved'); $redirect_type = Configuration::get('PS_CANONICAL_REDIRECT');
header('location: http://'.$url); if ($redirect_type != 0) {
exit; $redirect_code = ($redirect_type == 1 ? '302' : '301');
header('HTTP/1.0 '.$redirect_code.' Moved');
header('location: http://'.$url);
exit;
} else {
$shop = $default_shop;
}
} }
elseif (defined('_PS_ADMIN_DIR_') && empty($shop->physical_uri)) elseif (defined('_PS_ADMIN_DIR_') && empty($shop->physical_uri))
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment