Switched to HTTPS - images now broken

Re: Switched to HTTPS - images now broken

by Ken Task -
Number of replies: 0
Picture of Particularly helpful Moodlers

Am confused about this strand/thread ... probably because your posting is mixed in with another users.

So ... if you did what you said:

"Basically, I ran the search and replace thus:

old: http://sitename 

new: http://sitename"

You changed nothing ... when moving from http to https the search should have been for:

http://oldsite.fqdn/ (see the http://)

to

https://newsite.fqdn/

See the difference?

Two sites cannot have the same FQDN cause they map to different iP addresses.

So if you have some local copy of your production site and the search/replace works, you still might be able to pull resources from the production site into the local copy.

The way around that is to edit the local /etc/hosts file and make an entry:

privateIP fqdnofsite shortcutname

like:

192.168.0.12 www.mycoolmoodle.org mycool

All systems read host file first before making queries of DNS.

The other issue using localhost ... the cert ... don't think you can get a valid cert nor use the same cert from your Production server on a localhost implementation.   So the localhost web server / moodle is set to use https:// but the cert would not be valid ... so in firefox one has to make the exception.

Oh, yeah ... for https to work, port 443 must be open and, of course, one must edit the config.php file and change the  http:// to an https:// .... config.php file is read and re-read all the time.

'spirit of sharing', Ken