【问题标题】:How to call Multiple Website Store in sub folder of main magento installation?如何在主magento安装的子文件夹中调用多个网站商店?
【发布时间】:2018-04-11 05:10:51
【问题描述】:

如何在magento主安装的子文件夹中调用Multiple Website Store?

HowMultiple Website Store 在主magento 安装目录的子文件夹中调用相同的baken。

索引.php

$mageFilename = '../app/Mage.php';
require_once $mageFilename;
/* Store or website code */
$mageRunCode = isset($_SERVER['MAGE_RUN_CODE']) ? $_SERVER['MAGE_RUN_CODE'] : 'abc';
/* Run store or run website */
$mageRunType = isset($_SERVER['MAGE_RUN_TYPE']) ? $_SERVER['MAGE_RUN_TYPE'] : 'website';
Mage::run($mageRunCode, $mageRunType);

.htaccess 文件是:

RewriteCond %{REQUEST_URI} ^/abc/$
RewriteRule .* - [E=MAGE_RUN_CODE:store]
RewriteCond %{ENV:REDIRECT_MAGE_RUN_CODE} (.+)
RewriteRule .* - [E=MAGE_RUN_CODE:%1]

但是在类别 URL 之后转到 404 页面。

【问题讨论】:

  • 首先,您是否重新索引并清除了缓存?
  • 第二,你检查core_config_data中的web/unsecure/base_urlweb/secure/base_url是否设置正确?
  • 是的,已设置,媒体和 css 路径也已设置,只有 URL 无效设计部分运行成功

标签: php .htaccess magento


【解决方案1】:

如果类别 URL 返回 404 页面,请确保重新索引“目录 URL 重写”

【讨论】:

  • 如果您使用 404 页面(magento 404 页面)获得正确的商店输出。这意味着此类别由于某种原因不在 URL 索引中。如果是 apache(或任何网络服务器)404 页面,那么 .htaccess 有问题
【解决方案2】:

您的 .htacess 中似乎有任何问题。请用新文件更改您的 .htacess 文件,然后重新索引。

【讨论】:

    【解决方案3】:

    因此您可以删除 .htaccess 或 index.php 覆盖。

    $params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE] = $mageRunCode;
    $params[\Magento\Store\Model\StoreManager::PARAM_RUN_TYPE] = $mageRunType;
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-07-04
      • 2014-06-09
      相关资源
      最近更新 更多