【问题标题】:Magento Multiple Website on Subdomains with All Checkouts on One DomainMagento 子域上的多个网站,一个域上的所有结帐
【发布时间】:2011-11-30 17:14:07
【问题描述】:

我有一个使用 php-fcgi 在 nginx 上运行的 magento 站点。

我在 www 上建立了一个主要网站。与 SSL 结帐配合良好的子域。

我正在尝试在“插座”上的同一安装上设置另一个 magento 网站。将使用“www”的子域。 SSL 结帐。我有“出口”。子域网站工作,可以将项目添加到购物车,但是当我点击结帐时“www.”结帐页面 (www.site.com/outlet/onestepcheckout/) 返回 magento 404 not found 错误。有趣的是,购物车在 404 页面的标题中显示了正确的商品数量,因此它可以识别正确的商店/网站,但没有找到结帐页面。

“www.”的我的 nginx 配置文件。子域有以下条目:

location ~ ^/outlet/ {
set $website_code outlet;
rewrite ^/outlet/(.*)$ /$1 last;
}

【问题讨论】:

    标签: magento nginx


    【解决方案1】:

    我最终创建了一个子目录“outlet”并将 index.php 复制到其中。然后编辑新 index.php 中的包含引用以指向一个目录。有效的 nginx 配置的编辑是:

            location ~ ^/outlet/ {
                    set $website_code outlet;
    #               rewrite ^/outlet/(.*)$ /$1 last;
                    try_files $uri $uri/ /outlet/index.php;
                    index index.php;
                    expires        off; ## Do not cache dynamic content
    #               expires        30d;
                    fastcgi_pass   127.0.0.1:9000;
                    fastcgi_param  HTTPS $fastcgi_https;
                    fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
                    fastcgi_param  MAGE_RUN_CODE  $website_code;
                    fastcgi_param  MAGE_RUN_TYPE  website;
                    include        fastcgi_params; ## See /etc/nginx/fastcgi_params
                    fastcgi_read_timeout 180;
    
            }
    

    【讨论】:

    • 如果有人有更清洁的解决方案,请分享。
    猜你喜欢
    • 2015-07-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-06-10
    • 2015-02-24
    • 1970-01-01
    • 2016-06-16
    • 1970-01-01
    相关资源
    最近更新 更多