Hello,
I am currently facing an issue while setting up a multistore in Magento using subdirectories. My setup involves creating separate store views for different languages, and I'm trying to set each one up in its own subdirectory. I've followed various guides and tried different approaches, but I'm still encountering 404 errors whenever I try to access the store views via their subdirectories.
Here's what I have done so far:
<?php require realpath(__DIR__) . '/../app/bootstrap.php'; $params = $_SERVER; $params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE] = 'bg'; $params[\Magento\Store\Model\StoreManager::PARAM_RUN_TYPE] = 'website'; // store or website $bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $params); $app = $bootstrap->createApplication('Magento\Framework\App\Http'); $bootstrap->run($app);
RewriteEngine on RewriteCond %{REQUEST_URI} !^/pub/ RewriteCond %{REQUEST_URI} !^/setup/ RewriteCond %{REQUEST_URI} !^/update/ RewriteCond %{REQUEST_URI} !^/dev/ RewriteRule .* /pub/$0 [L] DirectoryIndex index.php
Despite doing all this, I'm still encountering 404 errors. I've checked my server's error logs, but I can't find anything that would point to the cause of these errors. I'm running on a cPanel & WHM setup and as far as I can tell, there are no server-side issues causing this.
-> https://prnt.sc/GdXJuGIxkOFV
Has anyone encountered this issue before? Could there be something I've missed, or is there something specific to my setup that's causing this issue? Any guidance would be greatly appreciated.
The system is Almalinux 8.8 with cPanel/WHM/Apache 2.4
Thank you.
Hello @GEORGITTAN991f
As I can understand your requirement you just need multi language setup for your site with language switcher option and the URL have the store code of your store.
to archive above requirement you need to follow below configurations.
https://experienceleague.adobe.com/docs/commerce-admin/config/general/web.html?lang=en
If you need more information then let me know.
If my answer is helpful full then please set the accept solution flag and kudos flag so other members can take the same reference.