Results 1 to 7 of 7
  1. #1
    Join Date
    Aug 2012
    Posts
    4
    Plugin Contributions
    0

    Default 404 On Add to Cart, Customer Account Setup, Customer Login

    I clean-installed Zen Cart v150 today. In the setup, everything returned fine (htaccess, CHMOD settings, everything) on Apache with PHP5/MySQL/CURL.

    However, when attempting to add an item to the cart, setting up a customer account, or logging in as a customer, the main_page 404's.

    No addons, no templates, just a standard install that causes this error. I've searched, and while other people have had this problem, I can't find a solution to it; they seem to just disappear or the error resolves itself randomly.

    I have also deleted the files/database and started from scratch with the same problems occurring.

    Thanks,
    Pat

  2. #2
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: 404 On Add to Cart, Customer Account Setup, Customer Login

    Sounds like you told the install to flip the ENABLE_SSL switch to ON, but your server doesn't have SSL enabled or you didn't specify a working SSL URL, hence the 404 ("Not Found") errors, because there is no service/page/site at the SSL URL you've told Zen Cart to generate by flipping that switch on.

    Edit your /includes/configure.php file and set ENABLE_SSL to 'false' until such time as you've got working SSL enabled on your domain. Then you can go back and tell Zen Cart that it can take advantage of it after you've got SSL working properly.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Aug 2012
    Posts
    4
    Plugin Contributions
    0

    Default Re: 404 On Add to Cart, Customer Account Setup, Customer Login

    Code:
    define('ENABLE_SSL', 'false');
    It's set to false in the main config file. However it is set to true in ipncheck.php in the extras folder, should that be set to false also?

    After setting it to true in "ipncheck.php" and verifying 'false' in the configure.php file, there was no change.

    http://www.thunder-nationstore.com/ is the URL in case that will help.

  4. #4
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: 404 On Add to Cart, Customer Account Setup, Customer Login

    Okay, then to debug what's causing the system to redirect you to the page-not-found, go to Admin->Configuration->My Store->Missing Page Check, and turn it off. Then try to access one of those pages again.
    One primary cause of getting directed to main_page=page_not_found is simply that the system folder for the page you're accessing doesn't exist, such as would happen if your FTP upload of files failed at some point.

    But your problem does appear to be deeper than that.

    How exactly did you do this install?
    And have you made any changes to the settings in Admin->Configuration->Sessions? Usually the defaults are appropriate and most of the time when people change those settings they complain that their store breaks, but it takes us dragging it out of them that they made settings changes.

    Your symptoms are that you're getting a new zenid (session id) on each page click, and it's getting that zenid attached to the URL every click as well. This indicates a sessions problem, mainly in that the system isn't able to set a session cookie that it's able to retrieve on the next page, and thus it has to resort to less efficient (and less secure) ways to pass that info, such as using the URL.
    Since this is happening to multiple browsers, it suggests that your problem is server-side.
    So, go to Admin->Tools->Server Info, and copy+paste all that information here for some feedback.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  5. #5
    Join Date
    Jun 2003
    Location
    Newcastle UK
    Posts
    2,896
    Blog Entries
    2
    Plugin Contributions
    2

    Default Re: 404 On Add to Cart, Customer Account Setup, Customer Login

    Hi,

    A quick check on the cookie being created by your store shows that the cookie path is being set to
    /thundernation-store

    However you site does not contain that path in the URL's

    This is the reason that your site is regenerating a zenid for every page.

    Can you post the contents of your configure.php file here.
    Don't forget to hide any DB settings/passwords

    Thanks

  6. #6
    Join Date
    Aug 2012
    Posts
    4
    Plugin Contributions
    0

    Default Re: 404 On Add to Cart, Customer Account Setup, Customer Login

    @Wilt
    Okay, I use my own hosting with redirects in the httpd.conf file to redirect to subfolders based on domain. The redirects in the conf file are included below, along with the configure.php

    Code:
            #reditect for thunder-nationstore.com
            RewriteCond %{HTTP_HOST} ^(www.)?thunder-nationstore.com$
            RewriteCond %{REQUEST_URI} !thunder-nationstore/
            RewriteRule ^(.*)$ thunder-nationstore/$1 [L]
    Code:
    <?php
    // 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.thunder-nationstore.com/');
    define('HTTPS_SERVER', 'https://www.thunder-nationstore.com/');
    
    // Use secure webserver for checkout procedure?
    define('ENABLE_SSL', 'false');
    
    // 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', '/');
    define('DIR_WS_HTTPS_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/');
    
    // * 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/thunder-nationstore/');
    
    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', ''); // prefix for database table names -- preferred to be left empty
    define('DB_SERVER', 'localhost');
    define('DB_SERVER_USERNAME', '*********');
    define('DB_SERVER_PASSWORD', '*********');
    define('DB_DATABASE', '*******');
    
    // 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', '/enter/your/path/to/public_html_or_htdocs/and/zencart/here/zen/cache');
    EDIT:
    @Wilt, your discovery about the cookie path helped, and Dr, you're comment about the Sessions config tab helped as well.

    What appears to have fixed the problem is setting "Use root path for cookie path" to true. It appears to be working now.
    Last edited by patyork; 30 Aug 2012 at 04:36 PM. Reason: Possible Fix

  7. #7
    Join Date
    Jul 2011
    Posts
    6
    Plugin Contributions
    0

    Default Re: 404 On Add to Cart, Customer Account Setup, Customer Login

    Okay, it has been a couple of years, but this should be documented somewhere (sticky?)

    I was having the exact same problem as here and probably a dozen other similar threads that never seem to get resolved, at least in the forum postings.

    I had a perfectly functioning Zencart setup on my localhost test server. Uploaded it to my hosting service (config files properly edited to match) and suddenly customer login, checkout and other pages that used SSL, in whole or in part were getting 404 errors. I could figure out what was going on, but I did accidentally stumble on a solution in another, unrelated, thread. I, like a lot of people, had installed Zencart in a 'store' subdirectory. Not critical, but it does help with some things to have subdirectories the public doesn't see. A simple redirect sent customers to the right directory. This was never an issue until I changed hosting services and the new one had their own little 'pointer' setup in the control panel and my standard redirect in the index.php file didn't work. (Their support even told me once that "Redirects to the same domain are not allowed in html". That statement still confuses me.) Anyway, I finally moved my install from the /store directory to the web root, fixed both config files to match and everything works again. I don't know if it an issue with Zencart itself or, more likely, some web hosting services have hinky setups designed to squeeze every bit of cash out of customers by disallowing certain types of redirects to sell more hosting (only one domain per account sir/madam because we won't let you "cheat" with redirects).
    This also seems to freak out the SSL on these servers so that they can't find SSL pages like login, checkout, etc. without everything being in the root. Probably has something to do with whatever 'pointers' they are using that can't keep track of where the page is actually supposed to be between the SSL and non-SSL servers.

 

 

Similar Threads

  1. Replies: 14
    Last Post: 29 Dec 2012, 08:51 PM
  2. Customer Login and Add to Cart Pages go Blank
    By charals in forum General Questions
    Replies: 1
    Last Post: 20 Jul 2010, 03:20 AM
  3. Blank Page on customer login and add to cart.
    By Guy Incognito in forum General Questions
    Replies: 1
    Last Post: 31 Mar 2010, 01:34 PM
  4. Customer Login Page - 404 Error
    By bowsbride in forum General Questions
    Replies: 0
    Last Post: 14 Feb 2008, 05:42 PM
  5. Customer Login Logout error 404
    By stageweight in forum Managing Customers and Orders
    Replies: 5
    Last Post: 16 Oct 2007, 06:40 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR