0

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

sideshowbarker
  • 81,827
  • 26
  • 193
  • 197
  • Could you forward/redirect all http requests to the https counterpart? But it seems that the http version of the site is posting to the https version or vice versa. I would try to disable the http version of the site - or make the site name/title include the https if it doesn't already. Hope you can get it resolved. – Radmation Sep 15 '17 at 20:53
  • *“The response had HTTP status code 503.”* simply indicates “Service unavailable”. It seems like that’s the actual problem you need to identify the cause of and fix. The fact there’s no 'Access-Control-Allow-Origin' header in that response actually isn’t important, because the server is telling you there is some fatal error—some server-side failure—that prevents the server from proceeding further at all. (Many or most servers won’t add the 'Access-Control-Allow-Origin' header to 5xx or 4xx error responses—instead they only add that header to 2xx success responses.) – sideshowbarker Sep 15 '17 at 21:45

1 Answers1

0

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.

rhysclay
  • 1,645
  • 3
  • 22
  • 42