1

Magento 在我的 Nginx + PHP-FPM 堆栈上运行得很好,但是每次我从购物车中删除产品或在产品页面上添加标签时,我都会被重定向到主页。

我知道用$this->_redirectReferer(Mage::getUrl('*/*'));app $this->_redirect('checkout/cart');/code/core/Mage/Checkout/controllers/CartController.php 替换“修复”购物车问题,但是标签一呢?有什么规则我可以​​在 nginx.conf 上添加/改进而不是破解 Magento 核心?奇怪的是,这只发生在 Ngix 上,而不是 Apache 上。

这是我的配置的摘录:

        location @handler { ## Magento uses a common front handler
            rewrite / /index.php;
        }

        location ~ .php/ { ## Forward paths like /js/index.php/x.js to relevant handler
            rewrite ^(.*.php)/ $1 last;
        }

        # Pass PHP scripts on to PHP-FPM
        location ~* \.php$ {
            if (!-e $request_filename) { rewrite / /index.php last; } ## Catch 404s that try_files miss
            #expires        off; ## Do not cache dynamic content
            fastcgi_pass    unix:/var/spool/phpfpm.sock; ## php-fpm socket
            fastcgi_param   SCRIPT_FILENAME  $document_root$fastcgi_script_name;
            #fastcgi_param  MAGE_RUN_CODE default; ## Store code is defined in administration > Configuration > Manage Stores
            #fastcgi_param  MAGE_RUN_TYPE store;
            include         fastcgi_params; ## See /etc/nginx/fastcgi_params
        }
4

1 回答 1

0

回顾 Magento CE 1.4.2,库存的 Magento CartController.php控制器类没有任何看起来像这样的代码

$this->_redirectReferer(Mage::getUrl('/'));

我怀疑你正在处理一个已经被黑的系统。我会下载一个全新的安装并比较你的CartController.php文件。根据您提供的信息,我猜有人替换了以下行

$this->_redirectReferer(Mage::getUrl('*/*'));

上面的行会导致您的问题。

于 2012-10-02T20:23:18.540 回答