plugins – CORS Error when using TranslatePress and REST API
Question
I’m using the TranslatePress plugin to provide translations for my website. The default version is served without language slugs: example.com
, and the translated versions are served through example.com/en
(or any other two-letter language name slugs).
When using WordPress REST API, example.com/wp-json/...
works fine, but example.com/en/wp-json/...
throws CORS error:
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://example.com/en/wp-json/... (Reason: CORS header ‘Access-Control-Allow-Origin’ missing)
what should I do?
0
1 year
2021-03-22T13:44:37-05:00
2021-03-22T13:44:37-05:00 0 Answers
0 views
0
Leave an answer