magento-hide-default-store-code
magento-hide-default-store-code copied to clipboard
404 error
i have 7 languages with code, and its showing me 404 on defaullt with default url
@RDXSportsCom & @jreinke,
I'm having a similar issue, getting a 404 when I go to the default store view and the normal url behaviour when I select a different storeview.
Nothing in my exception.log either
Modifying the Line 26 in Bubble_HideDefaultStoreCode_Model_Observer can solve it.
old code: $requestUri = $request->getServer('SCRIPT_NAME') . '/' . $storeCode . '/' . $requestUri;
new code: $requestUri = '/' . $storeCode . '/' . $requestUri;
@SunshineTech's fix worked for a site we've been working on also, its a great module for retro fitting multi-store into an existing magento setup
Thanks for the fix
Not working for me in Magento 1.9.2. Still get 404 page :( and also a too many redirects error
@SunshineTech great catch!
@jreinke please accept PR
We have fixed in this way
<?php
public function onFrontInitBefore(Varien_Event_Observer $observer)
// ...
$hasGotScriptName = strpos($requestUri, $request->getServer('SCRIPT_NAME'));
// ...
$prefixScriptName = "";
if ($hasGotScriptName !== false) {
$prefixScriptName = '/' .trim($request->getServer('SCRIPT_NAME'), '/');
}
$requestUri = $prefixScriptName.'/' . $storeCode . '/' . $requestUri;