I have used this guide to setup multiple websites, stores, and store views. As follows
Multiple websites, stores, and store views
Turned on "Add the store code to the base URL"
Set Base URLS
Everything works fine except that the default website should have been the US shown in the screenshot above, which has a website and store ID of 1.
Now to access the US site you need yo go to xyz.com/us instead of it showing as the base url itself xyz.com
Is there something I'm missing in this setup? Cause the default home page xyz.com is now showing the following error.
**
Magento\Framework\Exception\NoSuchEntityException: The store that was requested wasn't found. Verify the store and try again. in /home/xyz/m230.xyz.com/vendor/magento/module-store/Model/StoreRepository.php:75 Stack trace: #0 /home/xyz/m230.xyz.com/vendor/magento/module-store/Model/StoreManager.php(168): Magento\Store\Model\StoreRepository->get('') #1 /home/xyz/m230.xyz.com/generated/code/Magento/Store/Model/StoreManagerInterface/Proxy.php(119): Magento\Store\Model\StoreManager->getStore('') #2 /home/xyz/m230.xyz.com/vendor/magento/module-store/Model/Resolver/Store.php(30): Magento\Store\Model\StoreManagerInterface\Proxy->getStore(NULL) #3 /home/xyz/m230.xyz.com/vendor/magento/framework/App/Config/ScopeCodeResolver.php(49): Magento\Store\Model\Resolver\Store->getScope(NULL) #4 /home/xyz/m230.xyz.com/vendor/magento/framework/App/Config.php(69): Magento\Framework\App\Config\ScopeCodeResolver->resolve('stores', NULL) #5 /home/xyz/m230.xyz.com/vendor/magento/module-developer/Model/Logger/Handler/Debug.php(63): Magento\Framework\App\Config->getValue('dev/debug/debug...', 'stores')
6 /home/xyz/m230.xyz.com/vendor/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php(31):
Magento\Developer\Model\Logger\Handler\Debug->isHandling(Array) #7 /home/xyz/m230.xyz.com/vendor/monolog/monolog/src/Monolog/Logger.php(344): Monolog\Handler\AbstractProcessingHandler->handle(Array) #8 /home/xyz/m230.xyz.com/vendor/magento/framework/Logger/Monolog.php(48): Monolog\Logger->addRecord(400, 'The store that ...', Array) #9 /home/xyz/m230.xyz.com/vendor/monolog/monolog/src/Monolog/Logger.php(707): Magento\Framework\Logger\Monolog->addRecord(400, 'The store that ...', Array) #10 /home/xyz/m230.xyz.com/vendor/magento/framework/App/Bootstrap.php(263): Monolog\Logger->error('The store that ...') #11 /home/xyz/m230.xyz.com/index.php(39): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http\Interceptor))
12 {main}
**