【发布时间】:2015-09-26 20:38:58
【问题描述】:
我无法让 wc-api/v3 在我的 EC2 上运行。我已经让它在我的mac本地工作了。
以下是我在安装 woocommerce 并使用自签名证书启用 https 后所做的。
1) 启用 API(默认启用) 2)将永久链接选项更改为“帖子名称” 3) 生成的 API 密钥和秘密
这与我在 mac 中所做的设置相同。由于我在我的 mac 中的文件夹结构,存在一些小的差异。
.htaccess 在我的 Mac 中:
BEGIN WordPress
RewriteEngine On
RewriteBase /wordpress/
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wordpress/index.php [L]
END WordPress
.htaccess 在我的 ec2 实例中:
BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
END WordPress
CRUL:
curl -k https://FQDN.OF.MY.SERER/wc-api/v3/products/categories -u ck_abigkey:cs_abigsecret
输出:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
404 Not Found
Not Found
The requested URL /wc-api/v3/products/categories was not found on this server.
Apache/2.2.31 (Amazon) Server at FQDN.OF.MY.SERVER Port 443
MAC 和 EC2 中的版本: WordPress 版本:4.3.1 Woocommerce 插件版本:2.4.7
【问题讨论】:
标签: wordpress api woocommerce