• TranslatePress is trying to load it’s script over http despite the site url being set to https. This makes the application infinitely load when pressing translate site. On the home page it redirects to http, causing a redirect loop as the hosting redirects it to https. On pages other than the homepage it will load over https, but TranslatePress changes the canonical and shortlink link tags to an http url like this: https://example.com/en/page-title/.

    All of this doesn’t happen on the non-translated version. I’ve disable all other plugins and switched to the standard theme before testing this. I don’t have any ideas anymore. Is there anything I can try?

    Thank you,
    Louis

Viewing 13 replies - 1 through 13 (of 13 total)
  • Hello Louis,

    Can you please go to the Settings > General: and there put https:// as the protocol you are using for the website?

    Please tell me if this option helped you or not so we can debug further this.

    Cheers,

    Thread Starter louis-lau

    (@louis-lau)

    Hey Denis, thanks for looking in to this.

    In my initial post: “despite the site url being set to https”

    It is already set to https.

    Thread Starter louis-lau

    (@louis-lau)

    Any ideas?

    Hi!
    Im having the exact same problem, with the exact same conditions. I wrote a ticket for the plugin’s developer, but no one is answering. Did you solve it? how?

    Thanks!!!

    PS: I have the business version of the plugin

    Thread Starter louis-lau

    (@louis-lau)

    Nope, still having the same issue. Glad to hear I’m not the only one. Maybe they will answer your ticket as you’re a paying customer? ??

    Yes, they answer with a no-that-usefull-troubleshoot

    Try force https by htacces or install the “really simple SSL” plugin. That solved the bad redirection for me(http instead of https) but not the infinite redirection.

    I discovered that the theme i created is causing this. Im now trying to localize the file that is causing it. Ill let you know in case my solution is your solution aswell.

    Greetings!

    Thread Starter louis-lau

    (@louis-lau)

    Hmm, weird. I changed to the default theme and disabled all other plugins, so that can’t be the case for me I don’t think. Yeah, those plugins are completely useless for this issue sadly :(.

    Thanks for keeping me in the loop ??

    Hi again! I let you with a copy of my last answer to the translatepress guys.

    “We tested as you said, and discovered that the problem was on the theme.

    Once we discovered this, we started with removing all theme’s files and adding them 1 by 1 via ftp, we eventually arrived to the conclussion that the problem was in the head.php file, particularly on the <?php wp_head(); ?> line, that is a native and needed wordpress function. We tested and came to the conclussion that the problem is not in our side, because when we eliminate our functions.php with the <?php wp_head(); ?> function still active, the problem doesn’t go away.

    Can you give me any clue? This is a theme coded from scratch, but i found that this is a problem that other users have too in other themes.

    Thanks a lot for your answer. Greetings!”

    although the problem is still not fixed, maybe our troubleshoot helps you

    I’m having an issue also caused by this using another plugin which is Customer Reviews.

    Ok, than it is clear where HTTP comes from. There seems to be a known issue with TranslatePress: https://www.ads-software.com/support/topic/translatepress-is-trying-to-load-over-http/ . It changes HTTPS to HTTP when our plugin retrieves the website URL. There are two ways to solve the problem:

    1. Reach out to TranslatePress support to check the problem with HTTP/HTTPS. TranslatePress should not change HTTPS to HTTP.

    ~

    Is there any way you guys can help?

    Here’s my topic at Customer Reviews: https://www.ads-software.com/support/topic/error-request-failed-with-status-code-404/

    • This reply was modified 4 years, 7 months ago by sergiom87.

    I just found out I have exactly the same problem. I get the ‘too many redirects’ on my translated homepage, everything else works fine.

    I accidentally tested the page with the redirect loop in Lighthouse and got this:

    Access to XMLHttpRequest at ‘https://mysite/?wc-ajax=get_refreshed_fragments&#8217; from origin ‘https://mysite&#8217; has been blocked by CORS policy: Request header field x-requested-with is not allowed by Access-Control-Allow-Headers in preflight response.

    Access to XMLHttpRequest at ‘https://mysite/wp-content/plugins/translatepress-multilingual/includes/trp-ajax.php&#8217; from origin ‘https://mysite&#8217; has been blocked by CORS policy: Response to preflight request doesn’t pass access control check: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.

    I have 2 ssl-certificates running, one with my host and one with Really Simple ssl. And I checked every place where I had to fill in my url, everything was https://.

    my website also redirected from https://www.redoxsignalisierung.de/ to https://www.redoxsignalisierung.de/.

    My provider checked that too and forced another redirection, so now you will not notice any difference when you want to check it out.

    But of course I would rather not have that issue, specially as the next website is in work. My provider (IONOS) reported several similar issues with this plugin.

    Please comment on this, why the plugin redirects to a not encrypted version???
    Not very helpful in these days …

    Besides the plugin works fine!

    • This reply was modified 3 years, 11 months ago by sachers.

    Place the following code into your functions.php:

    add_filter( 'redirect_canonical', function ( $redirect_url = '', $requested_url = '' ) {
        if ( preg_match( '/^http:\/\//', $redirect_url ) ) {
            $redirect_url = preg_replace( '/^http:\/\//', 'https://', $redirect_url );
        }
    
        return $redirect_url;
    }, 10, 2 );

    This will check all redirect url’s on having https:// instead of https://, fixing them as it goes.

    • This reply was modified 3 years, 5 months ago by Mike Madern.
Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘TranslatePress is trying to load over http’ is closed to new replies.