Title: REST API redirect loop with default language subdirectory
Last modified: August 25, 2026

---

# REST API redirect loop with default language subdirectory

 *  [joan1003](https://wordpress.org/support/users/joan1003/)
 * (@joan1003)
 * [2 weeks, 1 day ago](https://wordpress.org/support/topic/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/posts`
 * results in:
 * `ERR_TOO_MANY_REDIRECTS`
 * **2. With the default-language subdirectory `/en/`:**
 * `https://godleetikas.net/staging/en/wp-json/wp/v2/posts`
 * works correctly and returns the WordPress REST API JSON response.
 * I also tested:
 * `https://godleetikas.net/staging/en/wp-json/wp/v2/types/post?context=edit`
 * and WordPress correctly responds with:
 * `rest_forbidden_context` / status `401`
 * when 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_REDIRECTS` specifically
   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](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Frest-api-redirect-loop-with-default-language-subdirectory%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Support [Anghel Emanuel](https://wordpress.org/support/users/anghelemanuel99/)
 * (@anghelemanuel99)
 * [2 weeks ago](https://wordpress.org/support/topic/rest-api-redirect-loop-with-default-language-subdirectory/#post-19004292)
 * Hello there,
 * Thank you for reaching out to us!
 * Since this needs a further investigation, I suggest to open a ticket on our website
   and mention this ticket there. Here is the link to open a new ticket: [https://translatepress.com/support/ask-a-presale-question/](https://translatepress.com/support/ask-a-presale-question/)
   
   Have a great day!
 * Kind Regards,
 *  Thread Starter [joan1003](https://wordpress.org/support/users/joan1003/)
 * (@joan1003)
 * [1 week, 1 day ago](https://wordpress.org/support/topic/rest-api-redirect-loop-with-default-language-subdirectory/#post-19009077)
 * Thank you, I also opened a ticket in translatepress.com as per your request.
 * Here are the staging details and the behavior we are seeing:
    - WordPress staging URL: `https://godleetikas.net/staging/`
    - TranslatePress default language uses the `/en/` subdirectory.
    - This endpoint works correctly:
      `https://godleetikas.net/staging/en/wp-json/`
    - REST endpoints under `/staging/en/wp-json/...` also work correctly.
    - The equivalent REST endpoint without `/en/`, for example:
      `https://godleetikas.
      net/staging/wp-json/`enters a redirect loop / does not resolve correctly.
    - Normal frontend requests to `/staging/` are also automatically redirected 
      to `/staging/en/`.
    - WordPress is installed in the `/staging/` subdirectory.
 * We have already verified that the REST API itself is functional and that authenticated/
   protected REST endpoints behave correctly under `/staging/en/wp-json/`.
 * Could you please confirm:
    1. Whether this is expected behavior when “Use a subdirectory for the default language”
       is enabled.
    2. Whether `/staging/wp-json/` should remain accessible without the `/en/` prefix.
    3. If not expected, what specific TranslatePress setting, rewrite rule, or compatibility
       fix should be applied.
    4. Whether this is a known issue with WordPress installed in a subdirectory.
 * We can provide redirect headers or additional staging configuration if needed.

Viewing 2 replies - 1 through 2 (of 2 total)

You must be [logged in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Frest-api-redirect-loop-with-default-language-subdirectory%2F%3Foutput_format%3Dmd&locale=en_US)
to reply to this topic.

 * ![](https://ps.w.org/translatepress-multilingual/assets/icon.svg?rev=3166541)
 * [TranslatePress - Translate Multilingual sites with AI Translation](https://wordpress.org/plugins/translatepress-multilingual/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/translatepress-multilingual/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/translatepress-multilingual/)
 * [Active Topics](https://wordpress.org/support/plugin/translatepress-multilingual/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/translatepress-multilingual/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/translatepress-multilingual/reviews/)

## Tags

 * [redirect loop](https://wordpress.org/support/topic-tag/redirect-loop/)
 * [staging](https://wordpress.org/support/topic-tag/staging/)
 * [subdirectory](https://wordpress.org/support/topic-tag/subdirectory/)

 * 2 replies
 * 2 participants
 * Last reply from: [joan1003](https://wordpress.org/support/users/joan1003/)
 * Last activity: [1 week, 1 day ago](https://wordpress.org/support/topic/rest-api-redirect-loop-with-default-language-subdirectory/#post-19009077)
 * Status: not resolved