Wordpress Ninja Forms, Access-Control-Allow-Origin and admin-ajax.php

826 views Asked by At

So, I have this WP installed on Heroku and I've installed Ninja forms to it. Despite everything working OK locally, when I push it to Heroku, the form is not submited and I receive this error through the Chrome's Console:

Failed to load https://ratts.com.br/wp-admin/admin-ajax.php: No 
'Access-Control-Allow-Origin' header is present on the requested
resource. Origin 'http://ratts.com.br' is therefore not allowed 
access. The response had HTTP status code 503.

It's worthy to mention that this error is only delivered when I access the page via http, but when I access the page trough https the form works just fine, due to what I think to be a CORS problem. Anyone has any idea about how can I solve this issue? It have been three days of unsuccessful research already... rsrs

1

There are 1 answers

0
rhysclay On

I believe that http to https for the same domain is still considered CORS. You need to make sure all traffic is redirected from http to https. Take a look at this thread.