REST API redirect loop with default language subdirectory
-
Hello,
I am using the free version of TranslatePress with two languages (English and Spanish) on a WordPress/WooCommerce website.
I am currently testing updates on a staging copy of the site, located in the
/staging/subdirectory. I discovered a redirect loop involving the WordPress REST API when the TranslatePress option “Use subdirectory for the default language” is enabled.I can reproduce the issue consistently:
1. Without the language subdirectory:
https://godleetikas.net/staging/wp-json/wp/v2/postsresults in:
ERR_TOO_MANY_REDIRECTS2. With the default-language subdirectory
/en/:https://godleetikas.net/staging/en/wp-json/wp/v2/postsworks correctly and returns the WordPress REST API JSON response.
I also tested:
https://godleetikas.net/staging/en/wp-json/wp/v2/types/post?context=editand WordPress correctly responds with:
rest_forbidden_context/ status401when accessed directly without REST authentication. This suggests that the REST API itself is reachable and functioning through the
/en/path.The equivalent URL without
/en/enters the redirect loop.The TranslatePress language settings currently have:
- Free version of TranslatePress
- Two languages: English and Spanish
- “Use a subdirectory for the default language” = enabled
- “Force language in custom links” = enabled
I found another recent support topic reporting
ERR_TOO_MANY_REDIRECTSspecifically when enabling “Use subdirectory for default language,” which appears similar to what I am experiencing.Before changing server rules,
.htaccess, 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.Could you please advise what you recommend checking next, or what diagnostic information I can provide to identify the source of the redirect loop?
I would prefer to troubleshoot this first on staging without making changes to the live website.
Thank you.
The page I need help with: [log in to see the link]
You must be logged in to reply to this topic.