• Resolved stabilimenta

    (@stabilimenta)


    I just updated Contact Form 7 to version 5.1.1 running on WordPress 5.0.3
    My form now fails to send messages… I just get the little Ajax loader spinner. Inspecting code with console (Chrome) shows this error:
    Mixed Content: The page at 'https://folkheritage.org/contact/' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'https://folkheritage.org/wp-json/contact-form-7/v1/contact-forms/4/refill/'. This request has been blocked; the content must be served over HTTPS.

    Any thoughts?

    The page I need help with: [log in to see the link]

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Takayuki Miyoshi

    (@takayukister)

    Try clearing all page cache.

    Thread Starter stabilimenta

    (@stabilimenta)

    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!

    Thread Starter stabilimenta

    (@stabilimenta)

    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.

    Thread Starter stabilimenta

    (@stabilimenta)

    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.

    Thread Starter stabilimenta

    (@stabilimenta)

    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.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Mixed content http/https failure’ is closed to new replies.