Skip to content

Instantly share code, notes, and snippets.

@piotrekkaminski
Created January 29, 2014 20:22
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save piotrekkaminski/8696196 to your computer and use it in GitHub Desktop.
diff --git a/app/code/core/Mage/Core/Model/Url/Rewrite/Request.php b/app/code/core/Mage/Core/Model/Url/Rewrite/Request.php
index 773c781..4801473 100644
--- a/app/code/core/Mage/Core/Model/Url/Rewrite/Request.php
+++ b/app/code/core/Mage/Core/Model/Url/Rewrite/Request.php
@@ -140,7 +140,7 @@ class Mage_Core_Model_Url_Rewrite_Request
$fromStore = $this->_request->getQuery('___from_store');
if (!$this->_rewrite->getId() && $fromStore) {
- $stores = $this->_app->getStores();
+ $stores = $this->_app->getStores(false, true);
if (!empty($stores[$fromStore])) {
/** @var $store Mage_Core_Model_Store */
$store = $stores[$fromStore];
@@ -160,7 +160,7 @@ class Mage_Core_Model_Url_Rewrite_Request
$this->_setStoreCodeCookie($currentStore->getCode());
- $targetUrl = $this->_request->getBaseUrl() . '/' . $this->_rewrite->getRequestPath();
+ $targetUrl = $currentStore->getBaseUrl() . '/' . $this->_rewrite->getRequestPath();
$this->_sendRedirectHeaders($targetUrl, true);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment