0

What do i need to consider when using a ssl ceritifcate on my website. I have an sll set up on my server but at the moment i have the .hta file redirecting everyone to http://.

This is because if i visit the site over https:// there is a few things wrong.

Low Search doesnt work, Free Form doesnt work, Free members - basically asks if your sure you want to login as some things might not be secure. Control panel has no styles or javascript.

However the general website loads and operates fine.

Do i need to change some files to reflect https:// for everything to work properly?

Thanks for any help.

1
  • As Jarrett mentioned, as long as the site_url config is set to https, forms generated by EE (and its add-ons like Low Search) will post data over https.
    – Low
    Commented Mar 4, 2015 at 20:32

1 Answer 1

3

Low Search doesnt work, Free Form doesnt work, Free members - basically asks if your sure you want to login as some things might not be secure.

These add-ons usually use what you have configured in your "Admin > General Configuration > URL to the root directory of your site". You can also set/override the General Configuration settings using the /system/expressionengine/config/config.php file.

If using your config.php file to make the changes, you could use these basic settings to possibly fix some or all of the issues you're experiencing:

// check if https or http
$base_url = (!empty($_SERVER['HTTPS'])) ? 'https://' . $_SERVER['HTTP_HOST'] : 'http://' . $_SERVER['HTTP_HOST'];

// set as constant
define('BASE_URL', $base_url . '/');
define('BASE_PATH'. $_SERVER['DOCUMENT_ROOT']);

$config['site_url']                = BASE_URL;
$config['cp_url']                  = BASE_URL.'admin.php';

$config['theme_folder_path']       = BASE_PATH.'themes';
$config['theme_folder_url']        = BASE_URL.'themes/';

Control panel has no styles or javascript.

This would be due to the /themes/ folder path setting being invalid/incorrect. You can update it using the General Configuration or config.php file I mentioned above.

Do i need to change some files to reflect https:// for everything to work properly?

If you've configured your paths to be relative or based on the current URI, you shouldn't need to setup any special https redirect rules. However, I do recommend either forcing www or non-www for SEO and to prevent cross-domain errors. This would be done using your htaccess file:

https://stackoverflow.com/questions/4916222/htaccess-how-to-force-www-in-a-generic-way

7
  • I seem to have a problem with $config['theme_folder_path'] = BASE_PATH.'/themes'; When i look in general configuration i get BASE_URL/themes Commented Mar 5, 2015 at 16:23
  • Don't forget to add this line: define('BASE_PATH'. $_SERVER['DOCUMENT_ROOT']); somewhere before the $config['theme_folder_path'] Commented Mar 5, 2015 at 16:29
  • I basically copied and pasted what you wrote and everything is great. Apart from when i go to look at general config i get BASE_URLthemes Also the control panel works however the ssl padlock is amber not green like the front end and says that some things may be unsecure. Can you shed any light on this? Really appreciate your help. Commented Mar 5, 2015 at 16:32
  • I dont have a $config['theme_folder_path'] in my config file? is this normal? I have just added this now is that ok to do? $config['theme_folder_path'] = '/var/www/vhosts/mydomain.co.uk/httpdocs/themes/'; Commented Mar 5, 2015 at 16:38
  • Yeah it's normal. There's a long list of config variables that you can have in your config file and theme_folder_path isn't a typical config setting Commented Mar 6, 2015 at 18:46

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.