1

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?

2

2 Answers 2

1

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

1
  • Thank you!! :-) $live_site had a http:// but.... we didn't have problems with the site earlier. I think it happend after updating to 3.4.1. When $live_site is set to https is that not a problem for the pages that do not use ssl? And shouldn't Joomla change the base utl itself when a page has to be loaded in https?
    – Petra
    May 4, 2015 at 13:51
0

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 = JFactory::getApplication()->getBody();
    $pattern = '~<[^>]*["\']\Khttps?://~i';
    $replacement = '//';
    $buffer = preg_replace($pattern, $replacement, $buffer);
    JResponse::setBody($buffer);
}
1
  • I read this post, but I don't know how to make a plugin for this? And there is no http:// in my template, it's all with the code : '<?php echo $this->baseurl ?>/templates/<?php echo $this->template; ?>', images files are on the server and placed with JCE.
    – Petra
    May 1, 2015 at 9:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.