【问题标题】:Setting up a new store in a subdirectory in Magento 1.8在 Magento 1.8 的子目录中设置新商店
【发布时间】:2014-02-03 21:08:45
【问题描述】:

我在之前的 Magento 1.7 安装中使用过 this guide,它运行良好,但我现在使用的是 1.8 版,它似乎根本无法运行。

我对 index.php 进行了以下编辑:

$compilerConfig = MAGENTO_ROOT . '/../includes/config.php';

$mageFilename = MAGENTO_ROOT . '/../app/Mage.php'; 

正确地找到合适的文件。

我在最后添加了这个(lic23rdst 是网站名称):

$mageRunCode = 'lic23rdst'; 

$mageRunType = 'website'; 

Mage::run($mageRunCode, $mageRunType);

当我尝试访问新商店时,我收到以下消息:

app/Mage.php 没有找到

谁能帮我解决这个问题?

【问题讨论】:

    标签: php magento subdirectory


    【解决方案1】:

    为什么不直接对目录进行符号链接?

    ln -s otherstore .
    

    现在 store.com 和 store.com/otherstore 将指向同一个文件系统。

    您可以在index.php 中使用一些逻辑来确定商店代码应该是什么。

    您还可以选择在 URL 中包含商店代码,然后 Magento 将为您处理逻辑和文件系统。

    【讨论】:

    • 感谢您的回复!我已启用此功能,但我似乎无法以最初 tostny.com/index.php/breakfast.html 的方式访问该类别,它给了我一个 404 错误。访问新的商店视图tostny.com/lic23rdst 似乎也不起作用。我已经删除了带有 index.php 和 .htaccess 文件的文件夹。有没有我遗漏的步骤?
    • 在您的符号链接中,我认为您必须更改参数:ln -s otherstore . => ln -s . otherstore
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-12-11
    • 2023-03-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多