Like others, I tend to test the cart in house before uploading it to wherever I need to run the store. Sure going in to change the config.php file isn't that hard, but what if your dedicated box (or shared) has the exact same setup, minus the URL changes? Its rather annoying to go and change URLs, paths, etc each time you move or upload the files.
I came up with this, and it works perfectly for me, sub domains, folders past root, doesnt matter.
Current osCommerce Code:
CODE
define('HTTP_SERVER', 'http://yoururlhere');
define('HTTPS_SERVER', 'http://yoururlhere');
define('HTTP_COOKIE_DOMAIN', 'domainname');
define('HTTPS_COOKIE_DOMAIN', 'domainname');
define('DIR_FS_CATALOG', '/var/www/html/catalog/');
define('HTTPS_SERVER', 'http://yoururlhere');
define('HTTP_COOKIE_DOMAIN', 'domainname');
define('HTTPS_COOKIE_DOMAIN', 'domainname');
define('DIR_FS_CATALOG', '/var/www/html/catalog/');
My new code:
CODE
$domainurl = "http://" . $_SERVER['SERVER_NAME'];
$domainname = $_SERVER['SERVER_NAME'];
define('HTTP_SERVER', $domainurl);
define('HTTPS_SERVER', $domainurl);
define('HTTP_COOKIE_DOMAIN', $domainname);
define('HTTPS_COOKIE_DOMAIN', $domainname);
define('DIR_FS_CATALOG', $_SERVER['DOCUMENT_ROOT'] . '/catalog/');
$domainname = $_SERVER['SERVER_NAME'];
define('HTTP_SERVER', $domainurl);
define('HTTPS_SERVER', $domainurl);
define('HTTP_COOKIE_DOMAIN', $domainname);
define('HTTPS_COOKIE_DOMAIN', $domainname);
define('DIR_FS_CATALOG', $_SERVER['DOCUMENT_ROOT'] . '/catalog/');
This allows me to upload directly to my dedicated box, and I never have to touch the configure.php. Granted some people need to change their SQL information, but I have it include a file thats NOT in the public web section with all the proper information, then use variables to feed it.
Just my .2 cents, enjoy!
