Site maintenance: Sun 15 Nov, from 12:00 UTC, about 4–6 hours. Details

This cutover relies on some testing that is still incomplete so may be cancelled at short notice

Forums / General Questions / 404 after login but back button goes to account page with user logged in

404 after login but back button goes to account page with user logged in

Locked

Started by enigma101 on 23 Sep 2010, 10:27 AM · Views: 1,388

Results 1 to 5 of 5
This thread is locked. New replies are disabled.
23 Sep 2010, 10:27 AM
#1
enigma101 avatar

enigma101

New Zenner

Join Date:
Dec 2007
Posts:
6
Plugin Contributions:
0

404 after login but back button goes to account page with user logged in

Hi,

My store has been working fine for over a year but has recently started displaying a problem when customers login or out. I've spent 2 days searching the forum, tried various suggestions but had no luck.

After logging in as a customer I get a 404 page not found error but when I press the back button I am taken to my account page which is what should happen after login. From this point on all is well. I can browse products, add to cart and check out fine. I also get a 404 on logout and again the back button takes me to the main page logged out.

It appears that part of the url is missing so it could a problem in the configuration file by I can't see it.

Any help would be appreciated.
Richard

Zen Cart Ver. 1.3.5
PHP Ver. 5.2.14
MySQL Ver. 5.1.48
Using Apache 2 on linux hosted by Heart Internet

Store - configure.php follows:

// 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://mtcmotorcycles.co.uk');
define('HTTPS_SERVER', 'https://web170.secure-secure.co.uk');

// 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', '/mtcmotorcycles.co.uk/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', '/home/sites/mtcmotorcycles.co.uk/public_html/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', 'localhost');
define('DB_SERVER_USERNAME', '
');
define('DB_SERVER_PASSWORD', '');
define('DB_DATABASE', '
');
define('USE_PCONNECT', 'false'); // use persistent connections?
define('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', '/home/sites/mtcmotorcycles.co.uk/public_html/shop/cache');

Admin - configure.php follows:

/ 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://mtcmotorcycles.co.uk');
    define('HTTPS_SERVER', 'https://web170.secure-secure.co.uk');
    define('HTTP_CATALOG_SERVER', 'http://mtcmotorcycles.co.uk');
    define('HTTPS_CATALOG_SERVER', 'https://web170.secure-secure.co.uk');

// 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', '/shop//');
define('DIR_WS_CATALOG', '/shop/');
define('DIR_WS_HTTPS_ADMIN', '/mtcmotorcycles.co.uk/shop/
/');
define('DIR_WS_HTTPS_CATALOG', '/mtcmotorcycles.co.uk/shop/');

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/sites/mtcmotorcycles.co.uk/public_html/shop/****/');
define('DIR_FS_CATALOG', '/home/sites/mtcmotorcycles.co.uk/public_html/shop/');

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', '');
define('DB_SERVER', 'localhost');
define('DB_SERVER_USERNAME', '
');
define('DB_SERVER_PASSWORD', '');
define('DB_DATABASE', '
');
define('USE_PCONNECT', 'false'); // use persistent connections?
define('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', '/home/sites/mtcmotorcycles.co.uk/public_html/shop/cache');

23 Sep 2010, 1:42 PM
#2
drbyte avatar

drbyte

Sensei

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

Re: 404 after login but back button goes to account page with user logged in

What's your apache server error_log telling you is the cause of the 404 error?

.
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.

23 Sep 2010, 3:18 PM
#3
enigma101 avatar

enigma101

New Zenner

Join Date:
Dec 2007
Posts:
6
Plugin Contributions:
0

Re: 404 after login but back button goes to account page with user logged in

Thank you for your quick reply.

The url isn't in the error logs but the 404 page states: 'The requested URL /shop/index.php was not found on this server.'

The login page has the url: 'https://web170.secure-secure.co.uk/mtcmotorcycles.co.uk/shop/index.php?main_page=login&zenid=***'

The 404 page has the url: 'https://web170.secure-secure.co.uk/shop/index.php?main_page=index&zenid=***'

As you can see 'mtcmotorcycles.co.uk' is missing from the url and the reason why the file is not found.

When I click the back button the url is correct and I'm logged in. Everything is fine from this point on until I logout. when the 404 re-occurs.

Richard

23 Sep 2010, 3:31 PM
#4
drbyte avatar

drbyte

Sensei

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

Re: 404 after login but back button goes to account page with user logged in

You need to put the domain into the HTTPS_SERVER setting, not the DIR_WS_HTTPS_ setting

/includes/configure.php

define('HTTP_SERVER', 'http://mtcmotorcycles.co.uk');
define('HTTPS_SERVER', 'https://web170.secure-secure.co.uk[B]/mtcmotorcycles.co.uk[/B]');

// 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', '[B]/shop/[/B]');

.
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.

23 Sep 2010, 8:28 PM
#5
enigma101 avatar

enigma101

New Zenner

Join Date:
Dec 2007
Posts:
6
Plugin Contributions:
0

Re: 404 after login but back button goes to account page with user logged in

Thank you very much for your help DrByte.
The shop is working fine now.

Richard