最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

themes - On a Https site, Css and Js Url are back to http after redirect the site

programmeradmin0浏览0评论

I have a website: /

And I want to change into: /

I made this transformation in the Wp-DB on the table wp_options, i modified the fields: siteUrl and Home...

Now, after restarting Apache server, I cannot load the Theme Css and Js. also, while before I was loading all the Css and Js under href='https, now they are loaded under href='http.

I read different blog/solutions... / SSL Breaks Wordpress CSS /

but I'm little confused becasue it looks that there is not a unique common solution.

I have a website: https://media.example/blog/

And I want to change into: https://www.example/blog/

I made this transformation in the Wp-DB on the table wp_options, i modified the fields: siteUrl and Home...

Now, after restarting Apache server, I cannot load the Theme Css and Js. also, while before I was loading all the Css and Js under href='https, now they are loaded under href='http.

I read different blog/solutions... https://wordpress/support/article/changing-the-site-url/ SSL Breaks Wordpress CSS https://wordpress/support/topic/css-broken-after-moving-to-test-subdomain-without-ssl/

but I'm little confused becasue it looks that there is not a unique common solution.

Share Improve this question asked Feb 24, 2020 at 19:27 GiuseppeGiuseppe 1 1
  • 1 When you change a site's URL you really need to use a database migration plugin. WP serializes URLs in a lot of different tables, so CSS and JS not loading are a symptom of a larger problem. – WebElaine Commented Feb 24, 2020 at 19:32
Add a comment  | 

2 Answers 2

Reset to default 1

I'd use a "Search and Replace" plugin (I like "Better Search and Replace") to search for all http://www.example and replace with https://www.example . That will fix media URLs, for instance, and other settings.

It could also be that your theme is calling http resources rather than https. You could look in the Developer screen (F12 in your browser usually) at the Network tab to see what http (vs https) resources are being loaded, and use that info to find the source code that is using http instead of https.

Backup your database first, of course, although I've had no problems with the "Better Search and Replace" plugin.

Ok... I found this plug in https://wordpress/plugins/ssl-insecure-content-fixer/

My site is also behind a load balance and this plugin solved everything. It's running in real-time (I don't like that), but it keeps everything under control

发布评论

评论列表(0)

  1. 暂无评论