Zen Cart Logo
Forums / General Questions / Paths not working?

Paths not working?

Views: 686

Results 1 to 7 of 7
27 Mar 2011, 5:25 PM
#1
quixotic avatar

quixotic

New Zenner

Join Date:
Apr 2006
Posts:
15
Plugin Contributions:
0

Paths not working?

Probably not zen-cart related, but was wondering if anyone's seen this. Paths don't work. E.g. src="images/example.jpg" doesn't go to:
https://www.site.com/shop/images/example.jpg

it's looking here:
https://www.site.com/www.site.com/shop/images/example.jpg

Full paths also don't work, src="/images/example.jpg" doesn't go to:
https://www.site.com/images/example.jpg

It trying to find it here instead:
https://images/example.jpg

The cart worked fine months ago, but when I had to install a new SSL cert, I had major problems. Everything looked okay, but I couldn't login, or add items to the cart. Tried everything in the forums, finally reinstalled the cert. restarted the server, and viola, I could login, but now my paths are all jacked up. Nothing in .htaccess files, it seems like an apache thing, but I've no clue what to do... :(

27 Mar 2011, 5:28 PM
#2
kobra avatar

kobra

Black Belt

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

Re: Paths not working?

First off why are you set to access at https versus http

Might post your store side configure.php file contents

Use the <> code tags

27 Mar 2011, 5:53 PM
#3
quixotic avatar

quixotic

New Zenner

Join Date:
Apr 2006
Posts:
15
Plugin Contributions:
0

Re: Paths not working?

Forgot to mention... it looks like it's only happening with https. Since at some point in checkout, it's gotta go to https, I have to get it work, since anything with href, or src gets affected (i.e. links, css, and images).

...i'll post the config in a minute.

27 Mar 2011, 5:58 PM
#4
quixotic avatar

quixotic

New Zenner

Join Date:
Apr 2006
Posts:
15
Plugin Contributions:
0

Re: Paths not working?

<?PHP
/**
 * @package Configuration Settings circa 1.3.8
 * @copyright Copyright 2003-2007 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license [url]http://www.zen-cart.com/license/2_0.txt[/url] GNU Public License V2.0
 */


/*************** NOTE: This file is similar, but DIFFERENT from the "admin" version of configure.php. ***********/
/***************       The 2 files should be kept separate and not used to overwrite each other.      ***********/

// Define the webserver and path parameters
  // HTTP_SERVER is your Main webserver: eg-http://www.your_domain.com
  // HTTPS_SERVER is your Secure webserver: eg-https://www.your_domain.com
  define('HTTP_SERVER', 'https://www.site.com');
  define('HTTPS_SERVER', 'https:/www.site.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', '/shop/');
  define('DIR_WS_HTTPS_CATALOG', '/shop/');

  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', '/');

// * 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', '/var/www/vhosts/site.com/httpdocs/shop/');

  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', '');
  define('DB_SERVER', '127.0.0.1');
  define('DB_SERVER_USERNAME', 'xxx');
  define('DB_SERVER_PASSWORD', 'xxx');
  define('DB_DATABASE', 'xxx');
  define('USE_PCONNECT', 'false');
  define('STORE_SESSIONS', 'db');
  // for STORE_SESSIONS, use 'db' for best support, or '' for file-based storage

  // 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', 'none'); 
  define('DIR_FS_SQL_CACHE', '/var/www/vhosts/site.com/httpdocs/shop/cache');

// EOF
27 Mar 2011, 8:05 PM
#5
kobra avatar

kobra

Black Belt

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

Re: Paths not working?

Did you attempt to manually edit/enter these or allow the installer to do so??

  define('HTTP_SERVER', 'https://www.site.com');
  define('HTTPS_SERVER', 'https:/www.site.com'); 

Missing a "/" there

// * 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', '/var/www/vhosts/site.com/httpdocs/shop/'); 

Are you sure that this is your correct path???
var, www, and vhosts are normally replaced with your actual variables for them

define('DB_SERVER', '127.0.0.1'); 

127.0.0.1 is usually "localhost" but is this is working leave it alone

28 Mar 2011, 7:35 AM
#6
quixotic avatar

quixotic

New Zenner

Join Date:
Apr 2006
Posts:
15
Plugin Contributions:
0

Re: Paths not working?

unbelievable... I must've looked at that file a few dozen times, and for some reason never saw the missing backslash. so sorry to waste your time, but yeah, that was it. Thank you so much for pointing it out, I really appreciate it.:blush:

For what it's worth the latter half, the /var/www/vhosts/... is correct. It's PLESK's default directory structure (at least in CentOS), and it's where it places all of it's virtual hosts.

28 Mar 2011, 9:01 AM
#7
kobra avatar

kobra

Black Belt

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

Re: Paths not working?

I would suggest that you change this as Zen Cart is smart enough to auto switch for only those pages that require https

  define('HTTP_SERVER', 'http://www.site.com');
  define('HTTPS_SERVER', 'https://www.site.com');