Please help me figure out this mess, Woocommerce REST API, FastCGI and HTTPS
-
I’m using my POS to send my products to woocommerce with the help of the REST API.
However my server is using FastCGI, and trying to send it over always gave me a 401 error, so I went and read the Getting started with the REST API page and found out I had to change the htaccess file and add this:
#BEGIN WordPress <IfModule mod_rewrite.c> #METALOCATOR: This line added to allow basic authentication under FastCGI SetEnvIf Authorization .+ HTTP_AUTHORIZATION=$0 RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] #METALOCATOR: This line added to allow basic authentication under FastCGI #METALOCATOR: Establishes an environment variable used by the plugin only for URLs beginning with wp-json/ RewriteRule ^wp-json/.* – [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L] </IfModule> #END WordPress
Then I clicked send on postman and got it working, I could now upload my products to wordpress directly from my POS.
However my website wasn’t yet forcing https://, as soon as I forced https I got a 500 Error.
So what I did after was changing the HTTP text in the code above to HTTPS, and that didn’t take my site down, but now I’m back at square one getting a 401 error and not being able to upload my products again.
What am I doing wrong? If anyone can help me I’ll pay you a coffee or something.
I’m using Siteground btw.
- The topic ‘Please help me figure out this mess, Woocommerce REST API, FastCGI and HTTPS’ is closed to new replies.