• joan1003

    (@joan1003)


    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 to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Anghel Emanuel

    (@anghelemanuel99)

    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/

    Have a great day!

    Kind Regards,

    Thread Starter joan1003

    (@joan1003)

    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 to reply to this topic.