• Resolved John Lewis

    (@swiftmodders)


    Hi All,

    I am using the LiteSpeed Cache plugin on my WordPress instance. I’ve tested this on both the latest stable and v3.5.1. When activating the Localize Resources, it is posting the HTTP URL instead of the HTTPS. In addition, it only does this to the Google Tag Manager link. I am using a custom CDN with HTTPS link that is not being used for this also. None of my WordPress settings make reference to the HTTP link

    Any ideas why this might be happening?

    *Note: I have disabled localization for now because of the error. I can re-enable on request.

    • This topic was modified 4 years, 1 month ago by John Lewis.

    The page I need help with: [log in to see the link]

Viewing 15 replies - 1 through 15 (of 15 total)
  • Plugin Support qtwrk

    (@qtwrk)

    Hi,

    Could you please check in your WP setting -> general -> make sure both site URL and home URL are set to https:// ?

    Best regards,

    Thread Starter John Lewis

    (@swiftmodders)

    Hi,

    I did double-check that and both the “WordPress” and “Site” URLs are set to the HTTPS version.

    Plugin Support qtwrk

    (@qtwrk)

    Hi,

    Could you please enable localize , then post what was the full URL ?

    and if you manually access that URL , on both http and https , what does them return ?

    and please edit file /src/localization.cls.php , at line 83 ,you will see a line start with $content =

    add this code before that line

    error_log('checkpoint : ' . LITESPEED_STATIC_URL);

    then purge all and purge localized resources , then check your PHP error_log , you should see something like this

    checkpoint : https://mydomain.com/wp-content/litespeed

    please post that.

    and do remember remove that line after you have got the error log

    Best regards,

    Thread Starter John Lewis

    (@swiftmodders)

    Hi,

    The URL it generates when enabled is: https://swiftmodders.com/wp-content/litespeed/localres/www.googletagmanager.com/gtag/js?id=AW-777561196

    That is a 404 error “page not found” error. Also, that URL redirects automatically to the HTTPS variant.

    Here is what is logged:

    checkpoint : https://swiftmodders.com/wp-content/litespeed

    Timestamp: 2020-10-22 23:58:54 UTC

    Let me know if you need anything else.

    • This reply was modified 4 years, 1 month ago by John Lewis.
    Plugin Support qtwrk

    (@qtwrk)

    Hi,

    checkpoint : https://swiftmodders.com/wp-content/litespeed

    this is the issue , somehow it got http value from somewhere.

    please repeat that test , but this time , change the string “LITESPEED_STATIC_URL” to “WP_CONTENT_URL”

    Best regards,

    Thread Starter John Lewis

    (@swiftmodders)

    Hi,

    The same is reported:

    checkpoint : https://swiftmodders.com/wp-content

    Timestamp: 2020-10-23 00:04:58 UTC

    I did a search and replace of “https://swiftmodders.com” with “https://swiftmodders.com” in my database as well. So I’m unsure of where it’s coming from.

    Plugin Support qtwrk

    (@qtwrk)

    Hi,

    Yeah well , anyway , add this to your wp-config.php should fix it

    define( 'LITESPEED_STATIC_URL', 'https://swiftmodders.com/wp-content/litespeed' )

    then purge all , and check again

    Best regards,

    Thread Starter John Lewis

    (@swiftmodders)

    Same result.

    Plugin Support qtwrk

    (@qtwrk)

    Hi,

    my bad , wrong code

    use this

    define( 'LITESPEED_STATIC_URL', 'https://swiftmodders.com/wp-content/litespeed' );

    add it to your wp-config.php

    then purge all , specially purge opcache if you have it

    if still not working , repeat that “check point” thing , get the new value , see what is it defined to

    Best regards,

    Thread Starter John Lewis

    (@swiftmodders)

    I added the “;”, so that wasn’t the issue. Oddly enough, when I go to CDN and look under CDN Settings, the recommended values for my Included Directories are:

    https://swiftmodders.com/wp-content
    wp-includes

    Why would that be a recommended value from LiteSpeed Cache?

    Plugin Support qtwrk

    (@qtwrk)

    hmmmm

    could you please screenshot of it ?

    by default it should NOT add any domain name or scheme , but only shows the directory “wp-content”

    Thread Starter John Lewis

    (@swiftmodders)

    No problem, here you go:

    https://tinyurl.com/yy2s268p

    • This reply was modified 4 years, 1 month ago by John Lewis.
    Plugin Support qtwrk

    (@qtwrk)

    Hi,

    on last check on WP_CONTENT_URL

    checkpoint : https://swiftmodders.com/wp-content

    Timestamp: 2020-10-23 00:04:58 UTC

    I think something somewhere somehow somewhat , defined the WP_CONTENT_URL and makes LSCWP grabbed wrong value.

    try repeat the checkpoint to log out the LITESPEED_STATIC_URL value after you added that code.

    if it still being overriden , then you need to figure out what overrides it.

    Best regards,

    Thread Starter John Lewis

    (@swiftmodders)

    Thanks for all your help. Oddly enough, and I’m not sure how this is possible. Eventhough the value in my Site URL and WordPress URL were set to the HTTPS URL, the database value under wp_options for siteurl was still set to the HTTP URL.

    I’m baffled, but I’m glad changing it manually worked. That fixed everything, including removing the odd URL from the Include Directories field.

    Just letting you know in case someone else has this extremely odd issue happen to them.

    Plugin Support qtwrk

    (@qtwrk)

    Yeah well , sometimes weird thing happens ??

    glad to know and thanks for the solution

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘Mixed Content Error’ is closed to new replies.