magento-hide-default-store-code icon indicating copy to clipboard operation
magento-hide-default-store-code copied to clipboard

404 error

Open RDXSportsCom opened this issue 9 years ago • 7 comments

i have 7 languages with code, and its showing me 404 on defaullt with default url

RDXSportsCom avatar Jun 15 '15 08:06 RDXSportsCom

@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

rossmc avatar Jul 20 '15 17:07 rossmc

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 avatar Sep 04 '15 00:09 SunshineTech

@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

16hands avatar Oct 21 '15 00:10 16hands

Not working for me in Magento 1.9.2. Still get 404 page :( and also a too many redirects error

altafhussain10 avatar Nov 09 '15 06:11 altafhussain10

@SunshineTech great catch!

liuggio avatar Nov 17 '15 12:11 liuggio

@jreinke please accept PR

liuggio avatar Nov 17 '15 12:11 liuggio

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;

liuggio avatar Dec 14 '15 12:12 liuggio