{"id":19002949,"date":"2026-08-25T19:15:23","date_gmt":"2026-08-25T19:15:23","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/rest-api-redirect-loop-with-default-language-subdirectory\/"},"modified":"2026-08-25T19:15:23","modified_gmt":"2026-08-25T19:15:23","slug":"rest-api-redirect-loop-with-default-language-subdirectory","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/rest-api-redirect-loop-with-default-language-subdirectory\/","title":{"rendered":"REST API redirect loop with default language subdirectory"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Hello,<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I am using the free version of TranslatePress with two languages (English and Spanish) on a WordPress\/WooCommerce website.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I am currently testing updates on a staging copy of the site, located in the <code>\/staging\/<\/code> subdirectory. I discovered a redirect loop involving the WordPress REST API when the TranslatePress option <strong>\u201cUse subdirectory for the default language\u201d<\/strong> is enabled.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I can reproduce the issue consistently:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>1. Without the language subdirectory:<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>https:\/\/godleetikas.net\/staging\/wp-json\/wp\/v2\/posts<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">results in:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>ERR_TOO_MANY_REDIRECTS<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>2. With the default-language subdirectory <code>\/en\/<\/code>:<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>https:\/\/godleetikas.net\/staging\/en\/wp-json\/wp\/v2\/posts<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">works correctly and returns the WordPress REST API JSON response.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I also tested:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>https:\/\/godleetikas.net\/staging\/en\/wp-json\/wp\/v2\/types\/post?context=edit<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">and WordPress correctly responds with:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>rest_forbidden_context<\/code> \/ status <code>401<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">when accessed directly without REST authentication. This suggests that the REST API itself is reachable and functioning through the <code>\/en\/<\/code> path.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The equivalent URL without <code>\/en\/<\/code> enters the redirect loop.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The TranslatePress language settings currently have:<\/p>\n\n\n\n<ul>\n<li>Free version of TranslatePress<\/li>\n\n\n\n<li>Two languages: English and Spanish<\/li>\n\n\n\n<li>\u201cUse a subdirectory for the default language\u201d = enabled<\/li>\n\n\n\n<li>\u201cForce language in custom links\u201d = enabled<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">I found another recent support topic reporting <code>ERR_TOO_MANY_REDIRECTS<\/code> specifically when enabling \u201cUse subdirectory for default language,\u201d which appears similar to what I am experiencing.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Before changing server rules, <code>.htaccess<\/code>, WordPress URLs, or TranslatePress settings, I would like to determine what is generating this redirect and whether this is a known issue involving TranslatePress, the REST API, and a WordPress installation located in a staging subdirectory.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Could you please advise what you recommend checking next, or what diagnostic information I can provide to identify the source of the redirect loop?<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I would prefer to troubleshoot this first on staging without making changes to the live website.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Thank you.<\/p>\n","protected":false},"template":"","class_list":["post-19002949","topic","type-topic","status-publish","hentry","topic-tag-redirect-loop","topic-tag-staging","topic-tag-subdirectory"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/19002949","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/19002949\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=19002949"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}