1

On example.org/contact everthing works fine. When i swtich language (Weglot) to example.org/de/contact - nothing happens when I submit the form, only infinite spinning.

In console i get:

"Failed to load resource: net::ERR_TOO_MANY_REDIRECTS" 
/wp-json/contact-form-7/v1/contact-forms/4833/feedback

As a result of wp-json, I get this response:

{"code":"rest_no_route","message":"No route was found matching the URL and request method","data":{"status":404}}

Error log on server:

"POST /wp-json/contact-form-7/v1/contact-forms/4833/feedback HTTP/1.1" 301 0 "https://example.org/de/contact" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.54 Safari/537.36" 0.066 "runtime: proxy" "server: example.com"
"GET /wp-json/contact-form-7/v1/contact-forms/4833/feedback HTTP/1.1" 301 0 "https://example.org/de/contact" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.54 Safari/537.36" 0.068 "runtime: proxy" "server: example.com"

When I add to my theme: add_filter( 'wpcf7_load_js', '__return_false' ); It works on translated pages, but i want ajax sbumit.

.htaccess:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

Anyone has ideas? Thanks in advance for your help.

JaKoZo
  • 314
  • 2
  • 14
  • 1
    check your server settings/htaccess to make sure `/wp-json/` is accessible. – Aurovrata Nov 02 '21 at 07:31
  • @Aurovrata my htaccess is default wordpress hta. When i open /wp-json/contact-form-7/v1/contact-forms/4833/feedback i get multiple redirections like this https://imgur.com/a/g1OxI6L and then https://imgur.com/a/yAqsDF6 404: – JaKoZo Nov 02 '21 at 07:42
  • when accessing `/wp-json/contact-form-7/v1/contact-forms/4833/feedback` from your browser you should get a JSON response and not a 404. This is an indication that your server is redirecting or blocking the page, see some of the answers to this [question](https://stackoverflow.com/questions/34670533/wordpress-rest-api-wp-api-404-error-cannot-access-the-wordpress-rest-api). – Aurovrata Nov 03 '21 at 09:51

0 Answers0