Try clearing all page cache.
Hello,
I do use WP Super Cache, but clearing it didn’t fix it.
I tried forcing https via the htaccess code, which fixed the mixed content load, but one issue still exists.
My WordPress install is located in a subdirectory (/wp/), but one of the CF7 paths is pointing to the wrong location:
GET https://folkheritage.org/wp-json/contact-form-7/v1/contact-forms/4/feedback/ 404 (Not Found)
Thank you!
Strange… the link does work when clicked directly, but is throwing a 404 from the page with the CF7 form.
Strange… the link does work when clicked directly, but is throwing a 404 from the page with the CF7 form.
The link also does not work when clicked directly, it’s still 404 response, just in JSON format (not HTML).
My WordPress install is located in a subdirectory (/wp/), but one of the CF7 paths is pointing to the wrong location
The location is correct, /wp-json/ is virtual path (same like /contact/). See for example: https://folkheritage.org/wp-json/wp/v2/pages/
It seems that the problem is related to the fact that for some reason the request is issued as GET request instead of POST. The /wp-json/contact-form-7/v1/contact-forms/4/feedback/ end-point expects POST requests only, thus 404 error is returned. But why this is happening I sadly have no idea…
Ok, it just got to me 🙂
I tried forcing https via the htaccess code, which fixed the mixed content load, but one issue still exists.
This fixes the problem with mixed content, but the rewrite inherently changes request type from POST to GET. So you have to fix the mixed content problem other way.
UPDATE:
I removed the forced redirect in the htaccess file.
I tried deactivating all other plugins and tried the Twenty-Fifteen theme.
I am still getting this error:
https://folkheritage.org/wp-json/contact-form-7/v1/contact-forms/4/feedback/ 404 (Not Found)
Hi @stabilimenta,
do you have any redirect rule (in .htaccess or in code) that adds trailing slashes to requests?
Because this works:
POST https://folkheritage.org/wp-json/contact-form-7/v1/contact-forms/4/feedback/
But this (notice the missing trailing slash) does not. POST request is rewritten to GET and then 404 is returned:
POST https://folkheritage.org/wp-json/contact-form-7/v1/contact-forms/4/feedback
Contact Form 7 does the request without trailing slash.
The host had a redirect on the htaccess file which was adding a trailing slash. Commenting that out fixed it. The contact form was working, and then it stopped. I’m not sure if the plugin changed or if the htaccess file was edited to start the issue. In any case, it’s working now. Thank you for your help @chesio.
I’m glad you managed to sort it out! 🙂
The host had a redirect on the htaccess file which was adding a trailing slash. Commenting that out fixed it.
You don’t have to comment the rule out, if you want to keep it, you just need to restrict it to GET requests only. Add the following line before corresponding RewriteRule in .htaccess:
RewriteCond %{REQUEST_METHOD} GET
This way POST requests (including those from Contact Form 7) won’t be affected by the rule.