Problem with SSL after update to Jooma 3.4.1

by Petra   Last Updated April 29, 2015 21:04 PM

Since the update to 3.4.1. I have problems with SSL redirection. The base url of images en css is not redirected to https so the pages won't load anymore. I can't find anything about this on google.

Does someone know how to fix this?

Tags : ssl


Answers 2


I had a similar problem some time ago. My problem was that some of the files were referenced using an absolute URL in the source code (beginning with http://. If that's the case with your site, the solution is to replace http:// with simply //. I ended up doing it manually, but David Fritsch suggested a small plugin to take care of this:

public function onAfterRender() {
    $buffer = JResponse::getBody();
    $pattern = '~(<[^>]{0,}["\'])(https?://)~iU';
    $replacement = '$1//';
    $buffer = preg_replace($pattern, $replacement, $buffer);
    JResponse::setBody($buffer);
}
johanpw
johanpw
April 29, 2015 16:53 PM

Here's a couple of things you can try:

  • Check the $live_site variable in your configuration.php file to see if it has a reference to an non-https url.

  • Check if your .htaccess file has some custom rewrite rules that covers CSS files and images.

  • Look at the source code of your live site and see how the URL is generated.

If you want to develop your own plugin, you should take a look at the following site: https://docs.joomla.org/J3.x:Creating_a_Plugin_for_Joomla

Bogowoe
Bogowoe
May 03, 2015 15:58 PM

Related Questions