Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / How to Get Rid of a 302 Redirect

How to Get Rid of a 302 Redirect

Locked

Views: 3,062

Results 1 to 6 of 6
This thread is locked. New replies are disabled.
13 Jul 2008, 2:33 AM
#1
frank0 avatar

frank0

New Zenner

Join Date:
Jul 2008
Posts:
4
Plugin Contributions:
0

How to Get Rid of a 302 Redirect

Hi! This is my first post so, I hope I picked the right category to post in.

I've downloaded and installed ZC and customized it to have the same look and feel as the site it is being integrated into. Everything has gone well until last night when after placing the recommended .htaccess files in folders having spider.txt or index.html, I then added some products to a category and went to Admin->Configuration->Website Maintenance and set "Down for Maintenance" = FALSE.

(I have not yet renamed the admin folder)

My problem is that when I try to view my store from outside the admin console by directly typing the URL, I keep getting a 302 redirect from the store area to the main URL of the site.

I'd really appreciate any advice on how to resolve this issue. The basic scenario is described as follows:

I enter the URL http://www.brobinsoncorporation/biz/
and get the following 302 redirect back to http://www.brobinsoncorporation.com:

#1 Server Response: http://www.brobinsoncorporation.com/biz/index.php
HTTP Status Code: HTTP/1.1 302 Moved Temporarily
Date: Sun, 13 Jul 2008 01:08:33 GMT
Server: Apache/1.3.41 (Unix) mod_log_bytes/1.2 mod_bwlimited/1.4 mod_auth_passthrough/1.8 FrontPage/5.0.2.2635 mod_ssl/2.8.31 OpenSSL/0.9.8b
X-Powered-By: PHP/5.2.5
Location: http://www.brobinsoncorporation.com
Connection: close
Content-Type: text/html
Redirect Target: http://www.brobinsoncorporation.com

#2 Server Response: http://www.brobinsoncorporation.com
HTTP Status Code: HTTP/1.1 200 OK
ETag: "9970031-1957-48711626"
Content-Length: 6487
Content-Type: text/html
Last-Modified: Sun, 06 Jul 2008 18:59:50 GMT

**I then enter http://www.brobinsoncorporation/biz/index.php and get the same 302 redirect.

Here is a snippet from http://www.brobinsoncorporation/biz/index.php
**

// $Id: index.php 1111 2005-04-05 01:51:19Z drbyte $
//

// send to domain root
session_write_close();
header('Location: ' . 'http://' . $_SERVER['HTTP_HOST']);
exit();
?>

**Here is a snippet from http://www.brobinsoncorporation/biz/includes/configure.php
**

/*************** 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.yourdomain.com
// HTTPS_SERVER is your Secure webserver: eg, https://www.yourdomain.com
define('HTTP_SERVER', 'http://brobinsoncorporation.com');
define('HTTPS_SERVER', 'https://brobinsoncorporation.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', '/biz/');
define('DIR_WS_HTTPS_CATALOG', '/biz/');

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

**Here is a snippet from http://www.brobinsoncorporation/biz/admin/includes/configure.php
**

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

// Define the webserver and path parameters
// Main webserver: eg-http://www.your_domain.com -
// HTTP_SERVER is your Main webserver: eg-http://www.your_domain.com
// HTTPS_SERVER is your Secure webserver: eg-https://www.your_domain.com
// HTTP_CATALOG_SERVER is your Main webserver: eg-http://www.your_domain.com
// HTTPS_CATALOG_SERVER is your Secure webserver: eg-https://www.your_domain.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
  • If you desire your entire admin to be SSL-protected, make sure you use a "https:" URL for all 4 of the following:
    */
    define('HTTP_SERVER', 'http://brobinsoncorporation.com');
    define('HTTPS_SERVER', 'https://brobinsoncorporation.com');
    define('HTTP_CATALOG_SERVER', 'http://brobinsoncorporation.com');
    define('HTTPS_CATALOG_SERVER', 'https://brobinsoncorporation.com');

// Use secure webserver for catalog module and/or admin areas?
define('ENABLE_SSL_CATALOG', 'false');
define('ENABLE_SSL_ADMIN', '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_ADMIN', '/biz/admin/');
define('DIR_WS_CATALOG', '/biz/');
define('DIR_WS_HTTPS_ADMIN', '/biz/admin/');
define('DIR_WS_HTTPS_CATALOG', '/biz/');

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/brobin05/public_html/biz/admin/');
define('DIR_FS_CATALOG', '/home/brobin05/public_html/biz/');

**Any ideas about what I am doing wrong?

Regards,
Frank0**

13 Jul 2008, 3:34 AM
#2
drbyte avatar

drbyte

Sensei

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

Re: How to Get Rid of a 302 Redirect

Frank0:

Here is a snippet from http://www.brobinsoncorporation/biz/index.php
[/B]

// $Id: index.php 1111 2005-04-05 01:51:19Z drbyte $
//

// send to domain root
session_write_close();
header('Location: ' . 'http://' . $_SERVER['HTTP_HOST']);
exit();
?>It seems like you've replaced the main index.php file by mistake.

13 Jul 2008, 6:39 PM
#4
frank0 avatar

frank0

New Zenner

Join Date:
Jul 2008
Posts:
4
Plugin Contributions:
0

Re: How to Get Rid of a 302 Redirect

I went ahead and tried copying the index.php file from the admin folder to the folder one level higher. When I enter the URL, all I get is a blank page.

Do I now need to reinstall to a different path and copy the index.php? Or, is there some other way? I sure don't want to make things worse.

Regards,
Frank0

13 Jul 2008, 6:46 PM
#5
drbyte avatar

drbyte

Sensei

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

Re: How to Get Rid of a 302 Redirect

  1. Did you make a backup of your site before you started editing and adding files? You should.
    Same with installing addons. Always make a backup first. Better yet, make your changes in a test copy of your site, not the live one.

  2. You can obtain the original Zen Cart files for your version of Zen Cart in the master download area on SourceForge. You can get the correct original index.php file from there: https://www.zen-cart.com/tutorials/index.php?article=323

13 Jul 2008, 7:19 PM
#6
frank0 avatar

frank0

New Zenner

Join Date:
Jul 2008
Posts:
4
Plugin Contributions:
0

Re: How to Get Rid of a 302 Redirect

DrByte:

  1. Did you make a backup of your site before you started editing and adding files? You should.
    Same with installing addons. Always make a backup first. Better yet, make your changes in a test copy of your site, not the live one.

I had not yet made a backup but will do so ASAP.

I did install a new instance of ZC in a different path and copied the index.php. I seem to be in good shape now. Thank you very much for your assistance.

Regards,
Frank0