phantomCoder
phantomCoder

Reputation: 1587

Wordpress migration from http to https causing CSS files not loading

I am trying to move my wordpress site from http to https://

These are the things I did

  1. From admin panel changed the url from http://example.com to https://example.com
  2. Took a db dump and replaced all http://example.com to https://example.com

Still some of the CSS files are loading with http://** as seen in the below image. Any pointers which file I need to change these urls to https ?

enter image description here

This is my .htaccess if that matters

# BEGIN WordPress
# The directives (lines) between `BEGIN WordPress` and `END WordPress` are
# dynamically generated, and should only be modified via WordPress filters.
# Any changes to the directives between these markers will be overwritten.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

Upvotes: 0

Views: 316

Answers (2)

splat1985
splat1985

Reputation: 1

Write

$_SERVER["HTTPS"] = "on";

first line of wp_config.php

Upvotes: 0

Argus Duong
Argus Duong

Reputation: 2654

In the short time, you can install this plugin (Really Simple SSL) to make all things (images, CSS, JS) works. When you have time, check if your CSS, JS is loaded dynamic or hardcoded. If it's hardcoded, changes all to dynamic and uninstall above plugin.

If you not have enough of time or don't have exprience, keep that plugin as no harm.

Upvotes: 1

Related Questions