0

I have a problem with a channel form working over https.My form allows users edit their profiles for a staff directory and has a lot of fields including some assets , wygwam and matrix fields.When i go to the page over https all of those fields aren't working and i get errors like


Blocked loading mixed active content "http://mysite/themes/third_party/wygwam/lib/ckeditor/ckeditor.js"

Blocked loading mixed active content "http://mysite/themes/third_party/assets/scripts/matrix.min.js?2.5"

So the obvious problem is that these fields are requesting files over http rather than https but im not sure why this is happening.

I have setup my site to convert relative paths in my config


  $protocol                          = (isset($_SERVER['HTTPS']) &&     $_SERVER['HTTP'] == 'on') ? 'https://' : 'http://';
  $base_url                          = $protocol . $_SERVER['HTTP_HOST'];
  $base_path                         = $_SERVER['DOCUMENT_ROOT'];
  $system_folder                     = APPPATH . '../';
  $images_folder                     = 'images';
  $images_path                       = $base_path . '/' . $images_folder;
  $images_url                        = $base_url . '/' . $images_folder;

  $env_config['index_page']          = '';
  $env_config['site_index']          = '';
  $env_config['base_url']            = $base_url . '/';
  $env_config['site_url']            = $env_config['base_url'];
  $env_config['cp_url']              = $env_config['base_url'] . 
'admin/index.php';
 $env_config['theme_folder_path']   = $base_path   . '/themes/';
 $env_config['theme_folder_url']    = $base_url    . '/themes/';
 $env_config['third_party_path']    = $base_path   '/admin/expressionengine/third_party/';

I have also set secure_return="yes" and secure_action="yes" in my form header so im not sure where I am going wrong

Thanks for any help

2 Answers 2

1

The issue is that your CP and themes folder are not set to run https.

Make sure your cp url and themes folder are set to run https://

You'll possibly run into the same thing with any "ACT=" urls if the protocols don't match.

0

Ok I have decided to set https as my default protocol So i changed this

 $protocol= (isset($_SERVER['HTTPS']) &&     $_SERVER['HTTP'] == 'on') ? 'https://' : 'http://';

to this

 $protocol=  'https://';

This has sorted my issues and I hope to move the whole site to https soon

Your Answer

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

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