diff --git a/CHANGELOG.md b/CHANGELOG.md index 759fd58..6c1d40c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## 2.1.1 (2020-04-29) + +[View Release](git@github.com:experius/Magento2-Module-Multiple-Website-Store-Code-Url.git/commits/tag/2.1.1) + +* [BUGFIX] Solved issue with api incorrect redirect because it requires the original storecode *(Lewis Voncken)* + + ## 2.1.0 (2020-04-24) [View Release](git@github.com:experius/Magento2-Module-Multiple-Website-Store-Code-Url.git/commits/tag/2.1.0) diff --git a/Plugin/Magento/Store/App/Request/StorePathInfoValidator.php b/Plugin/Magento/Store/App/Request/StorePathInfoValidator.php index 4a7170a..9f9d904 100644 --- a/Plugin/Magento/Store/App/Request/StorePathInfoValidator.php +++ b/Plugin/Magento/Store/App/Request/StorePathInfoValidator.php @@ -109,7 +109,7 @@ public function afterGetValidStoreCode( return $result; } - if ($result && strpos($request->getRequestUri(), "/{$websiteCode}_") !== false) { + if ($result && strpos($request->getRequestUri(), "/{$websiteCode}_") === 0) { $requestUri = str_replace("/{$websiteCode}_", "", $request->getRequestUri()); $response = $this->responseFactory->create(); $response->setRedirect($request->getDistroBaseUrl() . $requestUri, 301);