Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / configure.php for different subdomains

configure.php for different subdomains

Locked

Views: 3,998

Results 1 to 9 of 9
This thread is locked. New replies are disabled.
10 Oct 2006, 11:25 PM
#1
seville avatar

seville

New Zenner

Join Date:
May 2006
Posts:
46
Plugin Contributions:
0

configure.php for different subdomains

Hey Zenners,

I already setup a zencart for https://www.hummergearsales.com which works fine. I decided to split the products in three different shops. The main one will be https://www.hummergearsales.com then the two subdomains
https://www.jeep.hummergearsales.com and
https://www.autoaccessories.hummergearsales.com

I copied the hummerge_zencart database to hummerge_jeep and hummerge_autoaccessories which works fine and also copied all files from https://www.hummergearsales.com to the folder "jeep" and "autoaccessories". I adjust the two configure.php files of each new subdomains.

The folder catalog for https://www.hummergearsales.com is on the root folder
The folder catalog for https://www.jeep.hummergearsales.com is under jeep/ and for
https://www.autoaccessories.hummergearsales.com is under autoaccessories/

I add to the absolute paths in configure.php jeep/ or autoaccessories/ in the right place and kept the relative paths like they are under the main domain.

When I tested the new subdomains, they are working, but when I try to login to my admin it automatically goes to the admin of
https://www.hummergearsales.com and not to
https://www.jeep.hummergearsales.com or
https://www.autoaccessories.hummergearsales.com

Example: I'm in
https://www.jeep.hummergearsales.com/catalog/admin and I see the login screen, when I press on the login button it refers me to https://www.hummergearsales.com/catalog/admin/... and I'm in the admin of the main domain and not the jeep subdomain.

I tried to adjust the path in the configure.php files, but then I was able to go to the specific admin but some other links in the catalog didn't work or in https it didn't work.

I hope you can help me to set up everything right, so the subdomains are working fine with SSL, like the main domain. And I can go to every admin and it's not automatically changing to the main domain admin when I login into the admin area.

Hopefully I explained it good enough to understand.

Thanks a lot

I appreciate any help

Seville

P.S. I'm using Zencart 1.3.5

12 Oct 2006, 2:10 AM
#2
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: configure.php for different subdomains

Did you setup other databases for each of the subdomain installs?.

This is a DB application and you will need to have a DB for each install.

12 Oct 2006, 3:25 AM
#3
seville avatar

seville

New Zenner

Join Date:
May 2006
Posts:
46
Plugin Contributions:
0

Re: configure.php for different subdomains

Hey Kobra,

thanks for helping me. Like I said in my previous post, I copied the database hummerge_zencart to hummerge_jeep and hummerge_autoaccessories . Everything works fine. I also changed the database connection in each configure.php to the belonging database.

seville:

I copied the hummerge_zencart database to hummerge_jeep and hummerge_autoaccessories which works fine and also copied all files from https://www.hummergearsales.com to the folder "jeep" and "autoaccessories". I adjust the two configure.php files of each new subdomains.

I tried several option in this part

define('DIR_WS_ADMIN', '/catalog/admin/');
define('DIR_WS_CATALOG', '/catalog/');
define('DIR_WS_HTTPS_ADMIN', '/catalog/admin/');
define('DIR_WS_HTTPS_CATALOG', '/catalog/');

all of them with /jeep/ in front or only some and some adjustments worked to go to the admin, but not go to the different admin menus or it worked but not in https... and so on :down:

Hope you can help

Seville

12 Oct 2006, 3:35 AM
#4
maxima avatar

maxima

New Zenner

Join Date:
Jun 2006
Posts:
86
Plugin Contributions:
0

Re: configure.php for different subdomains

When you say you 'adjust the two configure files' does that include the server paths in admin/includes/configure.php? I did a similar thing as you and initially I had the same problem because of the config file in admin. Now it works fine.

12 Oct 2006, 3:59 AM
#5
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: configure.php for different subdomains

maxima:

When you say you 'adjust the two configure files' does that include the server paths in admin/includes/configure.php? I did a similar thing as you and initially I had the same problem because of the config file in admin. Now it works fine.

FYI, there are only two configure.php files ... /includes and /admin/includes

12 Oct 2006, 4:09 AM
#6
seville avatar

seville

New Zenner

Join Date:
May 2006
Posts:
46
Plugin Contributions:
0

Re: configure.php for different subdomains

yes, I adjusted both

Seville

12 Oct 2006, 4:47 AM
#7
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: configure.php for different subdomains

Try posting your admin config file x'ing out the DB & pass

12 Oct 2006, 1:18 PM
#8
seville avatar

seville

New Zenner

Join Date:
May 2006
Posts:
46
Plugin Contributions:
0

Re: configure.php for different subdomains

here is my admin/includes config

 <?php
//
/**
 *
 * @package Configuration Settings
 * @copyright Copyright 2003-2006 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 */


// Define the webserver and path parameters
  // Main webserver: eg, http://localhost - should not be empty for productive servers
  // HTTP_SERVER is your Main webserver: eg, http://www.yourdomain.com
  // HTTPS_SERVER is your Secure webserver: eg, https://www.yourdomain.com
  // HTTP_CATALOG_SERVER is your Main webserver: eg, http://www.yourdomain.com
  // HTTPS_CATALOG_SERVER is your Secure webserver: eg, https://www.yourdomain.com
  /* 
   * URLs for your site will be built via:  
   *     HTTP_SERVER plus DIR_WS_ADMIN or
   *     HTTPS_SERVER plus DIR_WS_HTTPS_ADMIN or 
   *     HTTP_SERVER plus DIR_WS_CATALOG or 
   *     HTTPS_SERVER plus DIR_WS_HTTPS_CATALOG
   * ...depending on your system configuration settings
   */
  define('HTTP_SERVER', 'http://www.jeep.hummergearsales.com');
  define('HTTPS_SERVER', 'https://www.jeep.hummergearsales.com');
  define('HTTP_CATALOG_SERVER', 'http://www.jeep.hummergearsales.com');
  define('HTTPS_CATALOG_SERVER', 'https://www.jeep.hummergearsales.com');

  // Use secure webserver for catalog module and/or admin areas?
  define('ENABLE_SSL_CATALOG', 'true');
  define('ENABLE_SSL_ADMIN', 'true');

// NOTE: be sure to leave the trailing '/' at the end of these lines if you make changes!
// * DIR_WS_* = Webserver directories (virtual/URL)
  // these paths are relative to top of your webspace ... (ie: under the public_html or httpdocs folder)
  define('DIR_WS_ADMIN', '/catalog/admin/');
  define('DIR_WS_CATALOG', '/catalog/');
  define('DIR_WS_HTTPS_ADMIN', '/catalog/admin/');
  define('DIR_WS_HTTPS_CATALOG', '/catalog/');

  define('DIR_WS_IMAGES', 'images/');
  define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/');
  define('DIR_WS_CATALOG_IMAGES', HTTP_CATALOG_SERVER . DIR_WS_CATALOG . 'images/');
  define('DIR_WS_CATALOG_TEMPLATE', HTTP_CATALOG_SERVER . DIR_WS_CATALOG . 'includes/templates/');
  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_CATALOG_LANGUAGES', HTTP_CATALOG_SERVER . DIR_WS_CATALOG . 'includes/languages/');

// * DIR_FS_* = Filesystem directories (local/physical)
  //the following path is a COMPLETE path to your Zen Cart files. eg: /var/www/vhost/accountname/public_html/store/
  define('DIR_FS_ADMIN', '/home/hummerge/public_html/jeep/catalog/admin/');
  define('DIR_FS_CATALOG', '/home/hummerge/public_html/jeep/catalog/');

  define('DIR_FS_CATALOG_LANGUAGES', DIR_FS_CATALOG . 'includes/languages/');
  define('DIR_FS_CATALOG_IMAGES', DIR_FS_CATALOG . 'images/');
  define('DIR_FS_CATALOG_MODULES', DIR_FS_CATALOG . 'includes/modules/');
  define('DIR_FS_CATALOG_TEMPLATES', DIR_FS_CATALOG . 'includes/templates/');
  define('DIR_FS_BACKUP', DIR_FS_ADMIN . 'backups/');
  define('DIR_FS_EMAIL_TEMPLATES', DIR_FS_CATALOG . 'email/');
  define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/');

// define our database connection
  define('DB_TYPE', 'mysql');
  define('DB_PREFIX', 'zen_');
  define('DB_SERVER', 'localhost'); // eg, localhost - should not be empty
  define('DB_SERVER_USERNAME', 'XXXXXX');
  define('DB_SERVER_PASSWORD', 'XXXXXX');
  define('DB_DATABASE', 'XXXXXX');
  define('USE_PCONNECT', 'false'); // use persistent connections?
  define('STORE_SESSIONS', 'db'); // leave empty '' for default handler or set to 'db'

  // The next 2 "defines" are for SQL cache support.
  // For SQL_CACHE_METHOD, you can select from:  none, database, or file
  // If you choose "file", then you need to set the DIR_FS_SQL_CACHE to a directory where your apache 
  // or webserver user has write privileges (chmod 666 or 777). We recommend using the "cache" folder inside the Zen Cart folder
  // ie: /path/to/your/webspace/public_html/zen/cache   -- leave no trailing slash  
  define('SQL_CACHE_METHOD', 'file'); 
  define('DIR_FS_SQL_CACHE', '/home/hummerge/public_html/jeep/catalog/cache');

?>

and here is my includes config, don't you need that too?

<?php
/**
 *
 * @package Configuration Settings
 * @copyright Copyright 2003-2006 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 */


// Define the webserver and path parameters
  // HTTP_SERVER is your Main webserver: eg, http://www.yourdomain.com
  // HTTPS_SERVER is your Secure webserver: eg, https://www.yourdomain.com
  define('HTTP_SERVER', 'http://www.jeep.hummergearsales.com');
  define('HTTPS_SERVER', 'https://www.jeep.hummergearsales.com');

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

// NOTE: be sure to leave the trailing '/' at the end of these lines if you make changes!
// * DIR_WS_* = Webserver directories (virtual/URL)
  // these paths are relative to top of your webspace ... (ie: under the public_html or httpdocs folder)
  define('DIR_WS_CATALOG', '/catalog/');
  define('DIR_WS_HTTPS_CATALOG', '/catalog/');

  define('DIR_WS_IMAGES', 'images/');
  define('DIR_WS_INCLUDES', 'includes/');
  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', DIR_WS_CATALOG . 'pub/');
  define('DIR_WS_TEMPLATES', DIR_WS_INCLUDES . 'templates/');

  define('DIR_WS_PHPBB', '/home/hummerge/public_html/phpbb/');

// * DIR_FS_* = Filesystem directories (local/physical)
  //the following path is a COMPLETE path to your Zen Cart files. eg: /var/www/vhost/accountname/public_html/store/
  define('DIR_FS_CATALOG', '/home/hummerge/public_html/jeep/catalog/');

  define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/');
  define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . 'pub/');
  define('DIR_WS_UPLOADS', DIR_WS_IMAGES . 'uploads/');
  define('DIR_FS_UPLOADS', DIR_FS_CATALOG . DIR_WS_UPLOADS);
  define('DIR_FS_EMAIL_TEMPLATES', DIR_FS_CATALOG . 'email/');

// define our database connection
  define('DB_TYPE', 'mysql');
  define('DB_PREFIX', 'zen_');
  define('DB_SERVER', 'localhost'); // eg, localhost - should not be empty
  define('DB_SERVER_USERNAME', 'XXXXXX');
  define('DB_SERVER_PASSWORD', 'XXXXXX');
  define('DB_DATABASE', 'XXXXXX');
  define('USE_PCONNECT', 'false'); // use persistent connections?
  define('STORE_SESSIONS', 'db'); // leave empty '' for default handler or set to 'db'

  // The next 2 "defines" are for SQL cache support.
  // For SQL_CACHE_METHOD, you can select from:  none, database, or file
  // If you choose "file", then you need to set the DIR_FS_SQL_CACHE to a directory where your apache 
  // or webserver user has write privileges (chmod 666 or 777). We recommend using the "cache" folder inside the Zen Cart folder
  // ie: /path/to/your/webspace/public_html/zen/cache   -- leave no trailing slash  
  define('SQL_CACHE_METHOD', 'file'); 
  define('DIR_FS_SQL_CACHE', '/home/hummerge/public_html/jeep/catalog/cache');

?>
 

Thanks a lot

Seville

12 Oct 2006, 3:47 PM
#9
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: configure.php for different subdomains

I only wonder if you have an SSL for this url?? as these are specific to each and sensitive to being http://www.xxx or htpp://xxx

I have not seen the effect of enabling SSL without an actual cert and this may or may not be the issue.

Hope that either this might be it or that another that knows the effect responds.

I am also relatively certian that entries such as ```
define('DIR_WS_ADMIN', '/catalog/admin/');
define('DIR_WS_CATALOG', '/catalog/');
define('DIR_WS_HTTPS_ADMIN', '/catalog/admin/');
define('DIR_WS_HTTPS_CATALOG', '/catalog/');

should reflect the path like:

define('DIR_WS_ADMIN', '/jeep/catalog/admin/');
define('DIR_WS_CATALOG', '/jeep/catalog/');
define('DIR_WS_HTTPS_ADMIN', '/jeep/catalog/admin/');
define('DIR_WS_HTTPS_CATALOG', '/jeep/catalog/');