Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Multiple domains and relative path structure


pcs

Recommended Posts

Ok, I have 7 domains. 1 is the primary and the rest are parked. My soon to be released site is a hybrid phpnuke + oscommerce website.

 

PHPNuke will follow relative paths for all 7 of my domains (or ip address if I choose to use it), so I am in good shape there. However, when going to the online store section, I am forced to configure an absolute path in my configure.php like so:

 

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

  define('HTTPS_SERVER', 'https://www.powertraincontrolsolutions.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.powertraincontrolsolutions.com');

  define('HTTPS_COOKIE_DOMAIN', 'www.powertraincontrolsolutions.com');

  define('HTTP_COOKIE_PATH', '/catalog/');

  define('HTTPS_COOKIE_PATH', '/catalog/');

  define('DIR_WS_HTTP_CATALOG', '/catalog/');

  define('DIR_WS_HTTPS_CATALOG', '/catalog/');

  define('DIR_WS_IMAGES', 'images/');

  define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/');

  define('DIR_WS_INCLUDES', 'includes/');

  define('DIR_WS_BOXES', DIR_WS_INCLUDES . 'boxes/');

  define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/');

  define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/');

  define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/');

  define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/');

 

  define('DIR_WS_DOWNLOAD_PUBLIC', 'pub/');

  define('DIR_FS_CATALOG', '/usr/home/powertra/public_html/catalog/');

  define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/');

  define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . 'pub/');

 

Meaning that when i enter my site on http://www.parkeddomain1.com and navigate the site, all the paths will stay with http://www.parkeddomain1.com/XXX until I navigate to the OsCommerce section. When I navigate through OsCommerce, all paths are forced from http://www.parkeddomain1.com/XXX to http://www.primarydomain.com/XXX. Is there a way to maintain a relative path structure in OsCommerce so that I can continue to navigate with http://www.parkeddomain1.com?

 

here is the live site, you can quickly see the problem when going from the PHPNuke section to the online OsCommerce store http://66.39.113.31 .

Link to comment
Share on other sites

Thanks,

 

That gave me enough to get me going i the right direction. I added the following flag to my catalog/includes/configure.php file:

 

$hostname = $_SERVER['HTTP_HOST'];

 

The only problem is that if I use any of my domains other than my primary one, I receive an error on the SSL certificate so I have to keep a static https:// entry. Which is not a big deal because everything is relative up until a user is actually checking out.

 

  $hostname = $_SERVER['HTTP_HOST'];

  define('HTTP_SERVER', 'http://' . $hostname); // eg, http://localhost - should not be empty for productive servers

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

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

  define('HTTP_COOKIE_DOMAIN', $hostname);

  define('HTTPS_COOKIE_DOMAIN', $hostname);

  define('HTTP_COOKIE_PATH', '/catalog/');

  define('HTTPS_COOKIE_PATH', '/catalog/');

  define('DIR_WS_HTTP_CATALOG', '/catalog/');

  define('DIR_WS_HTTPS_CATALOG', '/catalog/');

  define('DIR_WS_IMAGES', 'images/');

  define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/');

  define('DIR_WS_INCLUDES', 'includes/');

  define('DIR_WS_BOXES', DIR_WS_INCLUDES . 'boxes/');

  define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/');

  define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/');

  define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/');

  define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/');

 

  define('DIR_WS_DOWNLOAD_PUBLIC', 'pub/');

  define('DIR_FS_CATALOG', '/usr/home/powertra/public_html/catalog/');

  define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/');

  define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . 'pub/');

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...