2015-09-26 23 views
0

我無法在我的EC2上使用wc-api/v3。我已經在我的Mac本地工作。Woocommerce API:GET https://DNS.SERVER.NAME/wc-api/v3/products/categories 404(Not Found)

以下是我在安裝woocommerce並使用自簽名證書啓用https後完成的操作。

1)啓用API(默認啓用) 2)更改permlinks選項 「文章名稱」 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

回答