Mixed Content Error




Wordpress LScache Plugin: Mixed Content Error

Last Updated on: Wed, 15 Apr 2026 00:00:02
Hi All, I am using the LiteSpeed Cache plugin on my WordPress instance. Ive 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 2 years, 1 month ago by John Lewis. The page I need help with: https://swiftmodders.com/ Hi, Could you please check in your WP setting -> general -> make sure both site URL and home URL are set to https:// ? Best regards, Hi, I did double-check that and both the WordPress and Site URLs are set to the HTTPS version. 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, Hi, The URL it generates when enabled is: http://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 : http://swiftmodders.com/wp-content/litespeed Timestamp: 2020-10-22 23:58:54 UTC Let me know if you need anything else. Hi, checkpoint : http://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, Hi, The same is reported: checkpoint : http://swiftmodders.com/wp-content Timestamp: 2020-10-23 00:04:58 UTC I did a search and replace of http://swiftmodders.com&#8221 with https://swiftmodders.com&#8221 in my database as well. So Im unsure of where its coming from. 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, Same result. 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, I added the , so that wasnt the issue. Oddly enough, when I go to CDN and look under CDN Settings, the recommended values for my Included Directories are: http://swiftmodders.com/wp-content wp-includes Why would that be a recommended value from LiteSpeed Cache? 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 No problem, here you go: https://tinyurl.com/yy2s268p Hi, on last check on WP_CONTENT_URL checkpoint : http://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, Thanks for all your help. Oddly enough, and Im 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. Im baffled, but Im 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. Yeah well , sometimes weird thing happens glad to know and thanks for the solution



LiteCache Rush: Speed comes from using less, not from doing it faster



Reference