Arvind K.
Arvind K.

Reputation: 1294

Mixed Content: The page at 'https://example.com' was loaded over HTTPS, but requested an insecure stylesheet error in Wordpress site

Instead of genuine Mixed Content issue this seemed like more of a Wordpress issue hence posting here to find a resolution.

I have everything setup to work with https, though there is no valid certificate yet. here is the home page url https://tourpoule.nl. The home page loads but with Mixed content errors which seem to be generated by core Wordpress or theme functions. Attaching image:

enter image description here

Database does not have any url which would start with http://. I already have replaced them using search and replace script.

enter image description here

There is nothing in htaccess file except basic Wordpress setup code. I tried renaming it as well. I cleared all types of cache but still it does not work. The site is using twentytwenty theme and if I comment out css and javascript enque lines, some of the errors disappear but styles and scripts do not load(that is normal I know).

In the view source of page it shows mixed urls, some with https and style and javascript urls without https. see below: enter image description here

Interestingly if I click a stylesheet url i.e. http://new.tourpoules.nl/wp-content/themes/twentytwenty/style.css?ver=1.0 it redirects to https://new.tourpoules.nl/wp-content/themes/twentytwenty/style.css?ver=1.0

I am not sure what is going on and have got struck. I am not able to reach the client so that we can discuss turning ssl redirection off in nginx for this domain where it is redirecting everything to https if it is not https. Not sure if that is causing issue (I believe it is not as it has nothing to do with Wordpress mechanism to generate urls). Any help or direction is greatly appreciated.

Upvotes: 0

Views: 7447

Answers (2)

James Bondze
James Bondze

Reputation: 102

I can see your website is still unsecured, for what it's worth, get yourself letsencrypt ssl.

Back to you question, go to your database, open the wp_options table, change the siteurl item to https://tourpoules.nl and also change the home item to https://tourpoules.nl.

Upvotes: 1

Neal Developer
Neal Developer

Reputation: 595

If you have used search and replace DB master script or plugin it will not update inside meta files as well as and check for the function file have you Enqueue with https://

So will be better if you download SQL file and replace with below:

From:

http://new.tourpoules.nl

To

https://new.tourpoules.nl

and re-upload again

Upvotes: 0

Related Questions