Wednesday, November 21, 2012

How to configure osCommerce to work with SSL?

In order to configure osCommerce to work with SSL you should open the filepublic_html/catalog/includes/configure.php and make the following changes:

define('HTTP_SERVER', 'http://www.yourdomain.com'); // eg, http://localhost - should not be empty for productive servers
define('HTTPS_SERVER', 'https://yourdomain.com'); // eg, https://localhost - should not be empty for productive servers

define('ENABLE_SSL', true); // secure webserver for checkout procedure

define('HTTP_COOKIE_DOMAIN', 'www.yourdomain.com');
define('HTTPS_COOKIE_DOMAIN', 'yourdomain.com');
define('HTTP_COOKIE_PATH', '/catalog/');
define('HTTPS_COOKIE_PATH', '/catalog/');
define('DIR_WS_HTTP_CATALOG', '/catalog/');
define('DIR_WS_HTTPS_CATALOG', '/catalog/');


Similar to the above changes have to be made in the file public_html/catalog/admin/includes/configure.phpwhich is responsible for the admin area configuration.

In the above example we are configuring an osCommerce installation in the catalog directory with domainyourdomain.com. You should adjust the above settings to your details.

2 comments: