Woocommerce REST API 404 error

后端 未结 3 1160
旧巷少年郎
旧巷少年郎 2021-01-02 16:34

Since woocommerce released the 2.1 version with REST API feature, I tried to use it: I activated the API on my woocommerce admin panel but when I try to call the curl: http:

相关标签:
3条回答
  • 2021-01-02 16:54

    Try going, on the Admin Panel, to Settings -> Permalinks. On Default Settings radio group, select the "Post name" one. Save the changes.

    Worked for me; hope for you too. :)

    Source: this blog post.

    EDIT: Website is not available, so I put its Wayback Machine URL.

    0 讨论(0)
  • 2021-01-02 17:04

    Apart from answer shared above: Settings -> Permalinks. On Default Settings radio group, select the "Post name" one. Save the changes.

    I also had to manually update .htaccess file to reflect the changes I made (permalinks to "Post name", and the little Wordpress help text shown on the bottom of the page was really helpful:

    If your .htaccess file was writable, we could do this automatically, but it isn’t so these are the mod_rewrite rules you should have in your .htaccess file. Click in the field and press CTRL + a to select all.

    Basically copy the new mod_rewrite rules as instructed by Wordpress above and manually update your .htaccess file! doing this worked for me!

    0 讨论(0)
  • 2021-01-02 17:10

    I was having this same issue. I had forgotten to turn on the pretty perma links, but doing that didn't solve it for me.

    I also had to update my apache virtual host file because the AllowOverride was defaulted to None.

    <Directory /var/www/wordpress/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride All
                Order allow,deny
                allow from all
    </Directory>
    

    Once I updated this, and reloaded the Apache service, the API worked for me.

    0 讨论(0)
提交回复
热议问题