PrestaShop Forum

The best place in the world to ask questions about PrestaShop and get advice from our passionate community!

PrestaShop Forum

Jump to content

 

[SOLVED] Help with SSL link not working

3 replies to this topic
#1
m3media

    PrestaShop Newbie

  • Members
  • Pip
  • 1 posts
I have installed my store and have it set to use SSL - however apparently it is not set correctly in whatever file controls that. It only shows error which says, "can not find host http:// "

Can someone please tell me which file to modify to correct this?

#2
rocky

    PrestaShop Superstar

  • US Moderators
  • 9988 posts
Topics merged and moved
Check out Nethercott Constructions for PrestaShop guides and modules. Like us on Facebook for news updates.

#3
m3media

    PrestaShop Newbie

  • Members
  • Pip
  • 1 posts
Since no one seemed to know how to actually correct this issue I finally sorted it out myself and thought I would share.

In version 1.4.4 it seems that enabling SSL in Admin area does not typically work smoothly without doing some manual edits to the index.php file.

The lines as follows need to be edited by taking the 0, out of it.:

if ($config->get('config_ssl')) {
define('HTTPS_SERVER', 'https://' . substr($config->get('config_url'), 0, 7));
define('HTTPS_IMAGE', HTTPS_SERVER . 'image/');
} else {
define('HTTPS_SERVER', HTTP_SERVER);
define('HTTPS_IMAGE', HTTP_IMAGE);


So your corrected file should look like this:

if ($config->get('config_ssl')) {
define('HTTPS_SERVER', 'https://' . substr($config->get('config_url'), 7));
define('HTTPS_IMAGE', HTTPS_SERVER . 'image/');
} else {
define('HTTPS_SERVER', HTTP_SERVER);
define('HTTPS_IMAGE', HTTP_IMAGE);


Once this was done my SSL links worked perfectly.

#4
sknobel

    PrestaShop Newbie

  • Members
  • Pip
  • 5 posts
Thanks for this info m3media. I am glad someone is posting their solutions to the problem of getting ssl to work on prestashop. Quick question. My index.php file doesn't contain any of the code above. Can you tell me specifically which index file this is and where it is located.

Thanks.