Magento多商店首页404问题


Magento multi store - home page 404 issue

我们有一个magento网站与多商店的功能。我们在不同的域上设置了多个商店。我的主要网站主页工作正常,但在第二商店主页显示404页。

我已经检查了管理面板中的所有配置,似乎都是正确的。我进一步调查发现,它不是CMS控制器,而是调用产品控制器'product/view/id/2057'

谁能帮我解决这个错误?

Thanks in advance

这里似乎也提到了同样的问题,请查看,

2日回答:url https://magento.stackexchange.com/questions/202135/magento - 2 - multistore - -让- 404错误

========================

有两种解决方案,你可以遵循哪一个喜欢使用:-

第一个选项

System -> Configuration -> Web -> Url Options -> Add Store Code to Urls

将"是"设置为此选项,您的存储代码将自动附加在存储开关上,刷新缓存。这个解决方案要归功于@Priyank

第二个选项

1)创建商店视图

2)从管理面板中选择France store,并从管理面板中更改base url, base link url, Secure base url, Secure base link url (Stores -> Configuration -> General -> Web):

http://example.com/business/fr/
3)在根目录下创建文件夹,名称为fr

4)复制htaccess &目录

5)将index.php代码替换为代码

$bootstrap = 'Magento'Framework'App'Bootstrap::create(BP, $_SERVER);
 /** @var 'Magento'Framework'App'Http $app */
$app = $bootstrap->createApplication('Magento'Framework'App'Http');
$bootstrap->run($app);

与下面的代码

$params = $_SERVER;
$params['Magento'Store'Model'StoreManager::PARAM_RUN_CODE] = 'fr'; 

//存储与管理面板相同的代码

$params['Magento'Store'Model'StoreManager::PARAM_RUN_TYPE] = 'store';
$bootstrap = 'Magento'Framework'App'Bootstrap::create(BP, $params);
/** @var 'Magento'Framework'App'Http $app */
$app = $bootstrap->createApplication('Magento'Framework'App'Http');
$bootstrap->run($app);
6)创建符号链接
ln -s /var/www/html/http://example.com/business/app/ app 
ln -s /var/www/html/http://example.com/business/lib/ lib 
ln -s /var/www/html/http://example.com/business/pub/ pub 
ln -s /var/www/html/http://example.com/business/var/ var 
Here /var/www/html/http://example.com/business/ 
is path of your project to root directory change as per your own configuration.

不要忘记刷新缓存。

===============================

欢呼,Dasitha .