Jump to content

{base_dir} dosnt direct to https


Recommended Posts

Hello i have recently activated SSL and Force SSL.

On some pages in my shop i have some hardcoded images in my theme and i add the images by using this code.

img src="{$base_dir}/img/payment/nordea.png"

wich gives me an error for my certificate in the browsers.

The url to the image should load with https  but it only loads with http.

 

Anyone have an idea?

I have cleared cache etc.

 

PS 1.6

Edited by rfourt (see edit history)
Link to comment
Share on other sites

Yes ive started to think of that to.. but over 100 modules and ALOT of theme code to change.. So please save me atleast 4 hours on changing all the $base_dir to base_dir_ssl when it should be .... first of all done from start by activating SSL in admin but i can live with Haxxing the normal base_dir

Link to comment
Share on other sites

  • 1 month later...

both variables are defined in \controllers\FrontController.php

 

            'base_dir' => _PS_BASE_URL_.__PS_BASE_URI__,

            'base_dir_ssl' => $protocol_link.Tools::getShopDomainSsl().__PS_BASE_URI__,

 

ok, that works but is not a real solution. Thanks btw

Link to comment
Share on other sites

  • 4 years later...
  • 11 months later...

I hardly came across this post. Although it is old, I want to help those who still have the same problem.

To fix the problem, change {$ base_dir} to {if isset ($ force_ssl) && $ force_ssl}{$ base_dir_ssl}{else}{$ base_dir}{/ if} in the code sections where you want to force SSL.

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...