Jump to content
rfourt

{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)

Share this post


Link to post
Share on other sites

Is there some global file where i can set so $base_dir goes to https instead of http?

Or is it handled by the modules and set in there files?

Thank you.,

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

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__,
 

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites
On 4/20/2015 at 5:22 AM, bellini13 said:

why not use {$base_dir_ssl}

This worked for me.. Thanks!

Share this post


Link to post
Share on other sites

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.

  • Thanks 1

Share this post


Link to post
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...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More