1

I have one installation (2.1.4) running www.mysite.com - this site works fine

In admin I have setup a second website www.mysecondsite.com - this site also works fine

I have setup a third website (this one is where I am struggling). There are two store views, one with a code of 'en' and one with a code of 'cy'

I am trying to run each store view with the following urls:

en = http://mythirdsite.com/ cy = http://cy.mythirdsite.com/

However when I go to try each of these urls I get the following errors:

1 exception(s):
Exception #0 (Magento\Framework\Exception\NoSuchEntityException): No such entity.

Exception #0 (Magento\Framework\Exception\NoSuchEntityException): No such entity.
#0 /home/public_html/mysite.com/vendor/magento/module-store/Model/StoreResolver/Website.php(46): Magento\Store\Model\WebsiteRepository->get('en')
#1 /home/public_html/mysite.com/vendor/magento/module-store/Model/StoreResolver.php(136): Magento\Store\Model\StoreResolver\Website->getAllowedStoreIds('en')
#2 /home/public_html/mysite.com/vendor/magento/module-store/Model/StoreResolver.php(122): Magento\Store\Model\StoreResolver->readStoresData()
#3 /home/public_html/mysite.com/vendor/magento/module-store/Model/StoreResolver.php(85): Magento\Store\Model\StoreResolver->getStoresData()
#4 /home/public_html/mysite.com/vendor/magento/module-store/Model/StoreManager.php(154): Magento\Store\Model\StoreResolver->getCurrentStoreId()
#5 /home/public_html/mysite.com/var/generation/Magento/Store/Model/StoreManagerInterface/Proxy.php(119): Magento\Store\Model\StoreManager->getStore(NULL)
#6 /home/public_html/mysite.com/vendor/magento/module-store/Model/Resolver/Store.php(29): Magento\Store\Model\StoreManagerInterface\Proxy->getStore(NULL)
#7 /home/public_html/mysite.com/vendor/magento/framework/App/Config/ScopeCodeResolver.php(49): Magento\Store\Model\Resolver\Store->getScope(NULL)
#8 /home/public_html/mysite.com/vendor/magento/framework/App/Config.php(79): Magento\Framework\App\Config\ScopeCodeResolver->resolve('stores', NULL)
#9 /home/public_html/mysite.com/vendor/magento/module-store/Model/Store.php(793): Magento\Framework\App\Config->getValue('web/secure/base...', 'store')
#10 /home/public_html/mysite.com/var/generation/Magento/Store/Model/Store/Interceptor.php(232): Magento\Store\Model\Store->isCurrentlySecure()
#11 /home/public_html/mysite.com/vendor/magento/module-store/Model/Store.php(597): Magento\Store\Model\Store\Interceptor->isCurrentlySecure()
#12 /home/public_html/mysite.com/vendor/magento/framework/Interception/Interceptor.php(74): Magento\Store\Model\Store->getBaseUrl('link', NULL)
#13 /home/public_html/mysite.com/vendor/magento/framework/Interception/Chain/Chain.php(70): Magento\Store\Model\Store\Interceptor->___callParent('getBaseUrl', Array)
#14 /home/public_html/mysite.com/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\\Store\\M...', 'getBaseUrl', Object(Magento\Store\Model\Store\Interceptor), Array, 'urlSignature')
#15 /home/public_html/mysite.com/vendor/magento/module-theme/Model/Url/Plugin/Signature.php(64): Magento\Store\Model\Store\Interceptor->Magento\Framework\Interception\{closure}('link', NULL)
#16 /home/public_html/mysite.com/vendor/magento/framework/Interception/Interceptor.php(142): Magento\Theme\Model\Url\Plugin\Signature->aroundGetBaseUrl(Object(Magento\Store\Model\Store\Interceptor), Object(Closure))
#17 /home/public_html/mysite.com/var/generation/Magento/Store/Model/Store/Interceptor.php(143): Magento\Store\Model\Store\Interceptor->___callPlugins('getBaseUrl', Array, Array)
#18 /home/public_html/mysite.com/vendor/magento/module-store/Model/Store.php(1293): Magento\Store\Model\Store\Interceptor->getBaseUrl()
#19 /home/public_html/mysite.com/var/generation/Magento/Store/Model/Store/Interceptor.php(648): Magento\Store\Model\Store->getStorePath()
#20 /home/public_html/mysite.com/vendor/magento/module-store/Model/StoreCookieManager.php(70): Magento\Store\Model\Store\Interceptor->getStorePath()
#21 /home/public_html/mysite.com/vendor/magento/module-store/Model/Plugin/StoreCookie.php(70): Magento\Store\Model\StoreCookieManager->deleteStoreCookie(Object(Magento\Store\Model\Store\Interceptor))
#22 /home/public_html/mysite.com/vendor/magento/framework/Interception/Chain/Chain.php(52): Magento\Store\Model\Plugin\StoreCookie->beforeDispatch(Object(Magento\Framework\App\FrontController\Interceptor), Object(Magento\Framework\App\Request\Http))
#23 /home/public_html/mysite.com/vendor/magento/framework/Interception/Chain/Chain.php(63): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\\Framewo...', 'dispatch', Object(Magento\Framework\App\FrontController\Interceptor), Array, 'front-controlle...')
#24 /home/public_html/mysite.com/vendor/magento/module-page-cache/Model/App/FrontController/BuiltinPlugin.php(68): Magento\Framework\Interception\Chain\Chain->Magento\Framework\Interception\Chain\{closure}(Object(Magento\Framework\App\Request\Http))
#25 /home/public_html/mysite.com/vendor/magento/framework/Interception/Chain/Chain.php(67): Magento\PageCache\Model\App\FrontController\BuiltinPlugin->aroundDispatch(Object(Magento\Framework\App\FrontController\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
#26 /home/public_html/mysite.com/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\\Framewo...', 'dispatch', Object(Magento\Framework\App\FrontController\Interceptor), Array, 'front-controlle...')
#27 /home/public_html/mysite.com/vendor/magento/module-page-cache/Model/App/FrontController/VarnishPlugin.php(55): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http))
#28 /home/public_html/mysite.com/vendor/magento/framework/Interception/Interceptor.php(142): Magento\PageCache\Model\App\FrontController\VarnishPlugin->aroundDispatch(Object(Magento\Framework\App\FrontController\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
#29 /home/public_html/mysite.com/var/generation/Magento/Framework/App/FrontController/Interceptor.php(26): Magento\Framework\App\FrontController\Interceptor->___callPlugins('dispatch', Array, Array)
#30 /home/public_html/mysite.com/vendor/magento/framework/App/Http.php(135): Magento\Framework\App\FrontController\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))
#31 /home/public_html/mysite.com/vendor/magento/framework/Interception/Interceptor.php(146): Magento\Framework\App\Http->launch()
#32 /home/public_html/mysite.com/var/generation/Magento/Framework/App/Http/Interceptor.php(26): Magento\Framework\App\Http\Interceptor->___callPlugins('launch', Array, Array)
#33 /home/public_html/mysite.com/vendor/magento/framework/App/Bootstrap.php(258): Magento\Framework\App\Http\Interceptor->launch()
#34 /home/public_html/mysite.com/theschoolprintshop.co.uk/index.php(43): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http\Interceptor))

I can see it is not finding the store view code 'en', yet it does exist.

In my root installation folder I have sub folders for each site, each with their own index.php and .htaccess files

If I change the code in both the index.php and .htaccess files to use the third website store code instead of the store view code, the site works fine. However I need to use the store views for obvious reasons.

Please can anyone tell me what to check

Thanks

1

I actually found the answer to my question as I re-read my own question :) and realised where I went wrong. So for my own records and anybody else, in the index.php for my store view I had the following...

$params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE] = 'en';
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_TYPE] = 'website';

To look at a store view it must be this instead...

$params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE] = 'en';
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_TYPE] = 'store';

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.