diff --git a/classes/shop/Shop.php b/classes/shop/Shop.php index 4b074558f..f87074cd1 100644 --- a/classes/shop/Shop.php +++ b/classes/shop/Shop.php @@ -276,20 +276,17 @@ class ShopCore extends ObjectModel if ($id_shop && !$is_main_uri) { foreach ($results as $row) + { if ($row['id_shop'] == $id_shop && $row['main']) { - $main_uri = $row['uri']; - break; - } - if (isset($main_uri)) - { - // extract url parameters - $request_uri = substr($request_uri, strlen($found_uri)); + // extract url parameters + $request_uri = substr($request_uri, strlen($found_uri)); - header('HTTP/1.1 301 Moved Permanently'); - header('Cache-Control: no-cache'); - header('location: http://'.$row['domain'].$main_uri.$request_uri); - exit; + header('HTTP/1.1 301 Moved Permanently'); + header('Cache-Control: no-cache'); + header('location: http://'.$row['domain'].$row['uri'].$request_uri); + exit; + } } } }