【问题标题】:REST resources are not available in magentoREST 资源在 magento 中不可用
【发布时间】:2013-10-08 09:20:54
【问题描述】:

为了使用 magento rest api,我做了以下事情。

在窗口中

  • 使用 oauth 安装了 magento 1.7 CE(在 phpinfo 中检查)。
  • 已创建用户角色并为来宾用户授予所有权限。
  • 后来尝试通过URL访问其余资源

    http://localhost:8036/magento/index.php/api/products/?type=rest http://localhost:8036/magento/api/products/?type=rest http://localhost:8036/magento/api/rest/products/

    他们都没有工作。我现在能做什么?任何形式的帮助表示赞赏。 我已遵循 REST 的所有 magento 指南。

在 Ubuntu 中

  • 做同样的设置
  • 同时通过

    访问其余资源

    http://10.211.20.26/magento/api/rest/products/

    找不到

    在此服务器上找不到请求的 URL /magento/api/rest/products/。

我的两个 magento 安装中都有产品。

【问题讨论】:

    标签: magento rest magento-1.7


    【解决方案1】:

    看来你的重写坏了。我假设您正在运行 Apache HTTPd,因此请检查 Magento 安装根目录中的 .htaccess 并确保您的重写工作正常。您可以通过取消注释相应的行来做到这一点。请使用 RewriteLog 和 RewriteLogLevel 指令将日志记录添加到重写引擎。

    【讨论】:

    • 最后我通过更改 .htaccess 文件修复了它 "Order allow,deny" Order allow,deny Allow from全部 目录>
    • 我也遇到了同样的问题。灯塔的评论对我不起作用。我有原始的.htaccess。似乎重写正在工作。如果您能够进一步扩展您的答案,例如如何添加 RewriteLog 或 RewriteLogLevel,我们将不胜感激。如果相关,正在使用虚拟主机。
    猜你喜欢
    • 2015-07-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-02-07
    • 2017-09-18
    • 1970-01-01
    • 2014-07-01
    相关资源
    最近更新 更多