Zen Cart Logo
Forums / Upgrading to 1.5.x / After Upgrade Contact Us page Redirect Loop Error

After Upgrade Contact Us page Redirect Loop Error

Views: 2,099

Results 1 to 20 of 23
19 May 2015, 10:30 PM
#1
spawnie69 avatar

spawnie69

Totally Zenned

Join Date:
Sep 2005
Location:
Ocala, FL
Posts:
527
Plugin Contributions:
0

After Upgrade Contact Us page Redirect Loop Error

Upgraded my sub domain at http://gelcandlecompany.com/wholesale/ to 1.54

Contact Us link results in a redirect loop error. Is this because it's on a sub domain?

Is this because my secured SSL is located at the root https://www.gelcandlecompany.com ?

How can I get the contact us link functioning again?

20 May 2015, 1:11 AM
#2
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

Re: After Upgrade Contact Us page Redirect Loop Error

I'd guess that the URL-rewriting mod you have installed has erroneously directed the Contact Us link to a https URL. That link address also contains a zenid string, which it shouldn't.

20 May 2015, 1:19 AM
#3
gilby avatar

gilby

Totally Zenned

Join Date:
Aug 2005
Location:
Vic, Oz
Posts:
1,816
Plugin Contributions:
0

Re: After Upgrade Contact Us page Redirect Loop Error

its is alternating between
www.gelcandlecompany.com
and
www.gelcandlewholesale.com

Try turning the URL rewriter off temporarily and see if that fixes it

20 May 2015, 1:43 AM
#4
spawnie69 avatar

spawnie69

Totally Zenned

Join Date:
Sep 2005
Location:
Ocala, FL
Posts:
527
Plugin Contributions:
0

Re: After Upgrade Contact Us page Redirect Loop Error

I upgraded my site after pasting 1.54 files directly over my 1.39h site and upgrading database. I just installed 2 mods Ceon Card Manual and Ty Package tracker.

I had and SEO module before, are you saying this what could be the problem? Even after the upgrade?
I only seem to have the Contact Us link giving me a problem, what do you recommend.

The site works otherwise.

Thanks Stevesh for your help.

20 May 2015, 3:26 AM
#5
spawnie69 avatar

spawnie69

Totally Zenned

Join Date:
Sep 2005
Location:
Ocala, FL
Posts:
527
Plugin Contributions:
0

Re: After Upgrade Contact Us page Redirect Loop Error

gilby:

its is alternating between
www.gelcandlecompany.com
and
www.gelcandlewholesale.com

Try turning the URL rewriter off temporarily and see if that fixes it

I upgraded by copying the new zc files over 1.39h and upgrading db with zc install therefore my admin does not show that i have any rewriting mods like a SEO. The mods I had disappeared after my file transfer and upgrade.

https://Www.gelcandlecompany.com is site located at my root running 1.39h
https://Www.gelcandleswholesale.com is the sub folder site running the upgraded 1.54 site we are discussing located in the folder /wholesale

My configure files were updated during the zcinstall so I don't think I need to edit anything.

Site is on 5.4 pHp when I'm working on 1.54 admin and I switch to 5.2 when I work in admin on 1.39h.

Appreciate everyone's help.

20 May 2015, 4:55 AM
#6
gilby avatar

gilby

Totally Zenned

Join Date:
Aug 2005
Location:
Vic, Oz
Posts:
1,816
Plugin Contributions:
0

Re: After Upgrade Contact Us page Redirect Loop Error

spawnie69:

I upgraded by copying the new zc files over 1.39h and upgrading db with zc install therefore my admin does not show that i have any rewriting mods like a SEO. The mods I had disappeared after my file transfer and upgrade.

Www.gelcandlecompany.com is site located at my root running 1.39h
Www.gelcandleswholesale.com is the sub folder site running the upgraded 1.54 site we are discussing located in the folder /wholesale

My configure files were updated during the zcinstall so I don't think I need to edit anything.

Site is on 5.4 pHp when I'm working on 1.54 admin and I switch to 5.2 when I work in admin on 1.39h.

Appreciate everyone's help.Most of your links are like this

gelcandleswholesale.com/shippinginfo.html

iow they use gelcandleswholesale.com as the base

but the contact us is...

https://gelcandlecompany.com/wholesale/index.php?main_page=contact_us&zenid=1fr8v8cddguu0h2mbr01erp2b2

this link uses gelcandlescompany.com as the base
I suspect this link is "hard coded" into your site
Search for it and change it.

21 May 2015, 4:17 PM
#7
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,779
Plugin Contributions:
11

Re: After Upgrade Contact Us page Redirect Loop Error

Sorry, but I would suggest a more drastic approach. You have upgraded in a way that will only create problems at every turn.
If you have copies of the old site, get it going again and then try using http://tinyurl.com/kzrduzg as a method to properly upgrade.
You will save yourself hours and hours of misery down the road.

21 May 2015, 4:45 PM
#8
spawnie69 avatar

spawnie69

Totally Zenned

Join Date:
Sep 2005
Location:
Ocala, FL
Posts:
527
Plugin Contributions:
0

Re: After Upgrade Contact Us page Redirect Loop Error

gilby:

Most of your links are like this

gelcandleswholesale.com/shippinginfo.html

> iow they use **gelcandleswholesale.com** as the base
> 
> I see this and this runs on the /wholesale sub folder
> 
> but the contact us is...
> ```
https://gelcandlecompany.com/wholesale/index.php?main_page=contact_us&zenid=1fr8v8cddguu0h2mbr01erp2b2

this link uses gelcandlescompany.com as the base
I suspect this link is "hard coded" into your site
Search for it and change it.

I did a search and it is not hard coded.

Should I attempt to delete the old mod files since I just copied over for the 1.54 upgrade?

thank you

21 May 2015, 10:07 PM
#9
spawnie69 avatar

spawnie69

Totally Zenned

Join Date:
Sep 2005
Location:
Ocala, FL
Posts:
527
Plugin Contributions:
0

Re: After Upgrade Contact Us page Redirect Loop Error

Problem solved. Re installing the ultimate urls corrected the problem. Luckily I have only a couple of mods on this site.
Lesson learned....never do an overwrite upgrade.

22 May 2015, 3:42 AM
#10
spawnie69 avatar

spawnie69

Totally Zenned

Join Date:
Sep 2005
Location:
Ocala, FL
Posts:
527
Plugin Contributions:
0

Re: After Upgrade Contact Us page Redirect Loop Error

Well, I screwed up somehow. After clearing up this problem, I proceeded to look at my retail root site at https://www.gelcandlecompany.com
and discovered all my links are 404 file not found except for my Login/Account Home links at the top.

I uploaded of files today but not at my root that I was aware of. Any ideas??

22 May 2015, 4:08 AM
#11
spawnie69 avatar

spawnie69

Totally Zenned

Join Date:
Sep 2005
Location:
Ocala, FL
Posts:
527
Plugin Contributions:
0

Re: After Upgrade Contact Us page Redirect Loop Error

It looks like as similar problem? When you click category you'll notice the link flash at first with zencart url then a 404.

Can somehow the re install of ultimate urls to fix the upgraded sub domain site be the culprit?

What should I do? I cant believe this is happening, just when I fixed the issue at the sub domain .

22 May 2015, 4:10 AM
#12
lhungil avatar

lhungil

Totally Zenned

Join Date:
Feb 2012
Location:
mostly harmless
Posts:
1,818
Plugin Contributions:
4

Re: After Upgrade Contact Us page Redirect Loop Error

Please post the physical structure of your account (file and folder locations for both stores as well as indicating the web root of each). Also provide the contents of the .htaccess files in BOTH store's Zen Cart root (and any parent folders). Please use code tags (press the # on the editor when posting) to wrap the contents.

Please provide the installed version(s) of Ultimate URLs. Note at least on of your store's is reporting "down for maintenance.

If you are attempting to host two separate sites and one is located inside the public root of the other (against best practice, but common) special care needs to be taken to avoid conflicts.

22 May 2015, 12:37 PM
#13
spawnie69 avatar

spawnie69

Totally Zenned

Join Date:
Sep 2005
Location:
Ocala, FL
Posts:
527
Plugin Contributions:
0

Re: After Upgrade Contact Us page Redirect Loop Error

gelcandlecompany.com is at /public_html
gelcandleswholesale.com is located at /public_html/wholesale

gelcandlecompany.com .htaccess file:
"# Use PHP52CGI as default AddHandler fcgid-script .php"

gelcandleswholesale.com .htaccess file:
"###############################################################################

Add custom headers and options

###############################################################################

Notes:

Examples: Adding IE compatibility / edge flags, language and encoding flags,

php or suphp directives, configure other Apache modules such as page_speed,

and enable or disable Apache httpd options.

Do NOT configure anything directly relating to physical or virtual resources

in this section. These should be addressed later on in this file.

###############################################################################
#Options -Indexes

###############################################################################

Enable mod_rewrite processing using the rules in this .htaccess file

###############################################################################

Notes:

<IfModule> should be avoided at all costs. If mod_rewrite is not available

it is almost always better to return HTTP 500 status. This way we see there

is an issue as soon as the .htaccess file is uploaded.

For mod_rewrite to work, the Apache server option to allow symbolic links to

be followed must be enabled. Most providers supporting mod_rewrite will

already have it enabled for you, but if your rewrite rules are not working

you can un-comment the first directive below to manually enable the option.

Don't forget, mod_rewrite directives are processed in order until a matching

RewriteRule with the [L] flag is encountered. So the more specific a rule is

the closer it should appear to the top of this file.

###############################################################################
#Options +FollowSymLinks
RewriteEngine on

###############################################################################

Tell mod_rewrite where this file is relative to the server document_root

###############################################################################

Notes:

This directive should only be enabled if this .htaccess file is not placed

in the document_root (usually public_html, www, or web) of the (sub)domain.

An easy way to determine the location relative to the server document_root is

to look at the URL used to access a file in this folder. For example if you

access a "page" in the same folder as this file by typing in the URL

"www.mydomain.com/myfolder/index.html" then "myfolder" will be the location

of this file relative to the server document_root.

Another quick and easy way to determine the correct setting for this is to

look at the defined value for DIR_WS_CATALOG and DIR_WS_HTTPS_CATALOG in

Zen Cart's configure.php files. All three values should match.

Don't forget the leading and trailing /. This directive requires both!

###############################################################################
#RewriteBase /shop/

###############################################################################

Redirect if request was for index.php (no query)

###############################################################################

Notes:

This is only required if the site generates references to index.php with no

parameters. This rule will force a 301 redirect to the site root when a

request is made for "/index.php" with no query terms (?key=value).

###############################################################################
#RewriteCond %{QUERY_STRING} ^$
#RewriteRule ^index.php$ / [R=301,L]

###############################################################################

Add any custom 301 redirects

###############################################################################

Notes:

In general these should be few and far between. If you use a RewriteRule

be sure to add the L flag to let Apache mod_rewrite know to stop processing

and skip any RewriteRules defined later in the .htaccess file.

###############################################################################

###############################################################################

Redirect if request was for index.php (with or without query)

###############################################################################

Notes:

This is a performance optimization. If the request is for index.php simply

pass the request on and do not process any other mod_rewrite directives in

this file.

Basically this avoids the overhead of checking if index.php is a real file

or directory (used in subsequent mod_rewrite rules) before sending the

request to index.php.

###############################################################################
RewriteRule ^index.php$ - [L]

###############################################################################

Start Ultimate (SEO) URLs

###############################################################################

Notes:

You should not make any changes in this section unless you really understand

how it will impact your web site. Mistakes can break things.

###############################################################################

Handles the new URL formats

RewriteRule ^(.)-c-([0-9_]+)/(.)-p-([0-9]+)(.)$ index.php?main_page=product_info&products_id=$4&cPath=$2&%{QUERY_STRING} [L]
RewriteRule ^(.
)-c-([0-9_]+)/(.)-pi-([0-9]+)(.)$ index.php?main_page=popup_image&pID=$4&cPath=$2&%{QUERY_STRING} [L]
RewriteRule ^(.)-c-([0-9_]+)/(.)-pr-([0-9]+)(.)$ index.php?main_page=product_reviews&products_id=$4&cPath=$2&%{QUERY_STRING} [L]
RewriteRule ^(.
)-c-([0-9_]+)/(.)-pri-([0-9]+)(.)$ index.php?main_page=product_reviews_info&products_id=$4&cPath=$2&%{QUERY_STRING} [L]

Original (unchanged) URL formats

RewriteRule ^(.)-p-([0-9]+)(.)$ index.php?main_page=product_info&products_id=$2&%{QUERY_STRING} [L]
RewriteRule ^(.)-m-([0-9]+)(.)$ index.php?main_page=index&manufacturers_id=$2&%{QUERY_STRING} [L]
RewriteRule ^(.)-pi-([0-9]+)(.)$ index.php?main_page=popup_image&pID=$2&%{QUERY_STRING} [L]
RewriteRule ^(.)-pr-([0-9]+)(.)$ index.php?main_page=product_reviews&products_id=$2&%{QUERY_STRING} [L]
RewriteRule ^(.)-pri-([0-9]+)(.)$ index.php?main_page=product_reviews_info&products_id=$2&%{QUERY_STRING} [L]
RewriteRule ^(.)-ezp-([0-9]+)(.)$ index.php?main_page=page&id=$2&%{QUERY_STRING} [L]
RewriteRule ^(.)-c-([0-9_]+)(.)$ index.php?main_page=index&cPath=$2&%{QUERY_STRING} [L]

Rewrite all other requests (if the file / directory does not exist)

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?main_page=$1&%{QUERY_STRING} [L]

###############################################################################

Add any other directives relating to the handling of physical files

###############################################################################

Notes:

If processing makes it this far, the request was for a real file or folder.

Example: Adding further processing related to browser caching or security.

###############################################################################"

Where can I find the version of Ultimate urls for the down for maintenance site?
All I see in the admin is SEO URLs and date of install 1/03/13.

Thank you for helping. I thought the main site was always built at the root and additional stores are created at the sub folders.

My apologies, I to placed quotes in Dreamweaver but I guess it didn't work right.

22 May 2015, 4:44 PM
#14
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,779
Plugin Contributions:
11

Re: After Upgrade Contact Us page Redirect Loop Error

My apologies, I to placed quotes in Dreamweaver but I guess it didn't work right.Using Dreamweaver will often just make matters worse by incorporating "hidden" code that breaks Zen Cart. Not as bad as using Word but, both should not be used to create/edit files for Zen Cart.

22 May 2015, 4:51 PM
#15
spawnie69 avatar

spawnie69

Totally Zenned

Join Date:
Sep 2005
Location:
Ocala, FL
Posts:
527
Plugin Contributions:
0

Re: After Upgrade Contact Us page Redirect Loop Error

So next time I want to display code on forums I should use word and make sure I put quotes?
I will try not to use dreaweave and just use word when editing, thanks dbltoe

22 May 2015, 4:55 PM
#16
lhungil avatar

lhungil

Totally Zenned

Join Date:
Feb 2012
Location:
mostly harmless
Posts:
1,818
Plugin Contributions:
4

Re: After Upgrade Contact Us page Redirect Loop Error

spawnie69:

Where can I find the version of Ultimate urls ... All I see in the admin is SEO URLs and date of install 1/03/13. ...
Sounds like you may have alternative URL plugins installed in both stores... And may have mixed versions of the alternative URL plugin installed in the same store (or a different plugin installed?)...

The admin menu configuration has not been labelled as "SEO URLs" for quite a long time... Yet the .htaccess file contents you posted are from a recent version of Ultimate URLs... If both sites are running Zen Cart 1.3.9h or newer, you may want to first remove the older plugin(s) and upgrade both sites to the latest version of Ultimate URLs (don't forget to apply all relevant patches to Zen Cart and Ultimate URLs).

Ultimate URLs is available for download from this website. Click "Plugins" and then search for "Ultimate URLs".

And here is the support thread for modern versions of Ultimate URLs. There is currently one posted bugfix in the support thread for Ultimate URLs 2.215.

NOTE 1: There is some important information in the Ultimate URLs 2.215 release announcement.

NOTE 2: Make a full backup of the Zen Cart database and files before performing any updates / upgrades / patches. Always better safe than sorry.

spawnie69:

gelcandlecompany.com is at /public_html
gelcandleswholesale.com is located at /public_html/wholesale ...
Yup, nesting web server document roots such as the above can cause some conflicts (and is probably part of the problem).

If your hosting provider is still running PHP 5.2, I would highly recommend upgrading to PHP 5.4 as soon as feasible (keep in mind the Zen Cart server requirements depending on the versions of Zen Cart you have installed). You may need to contact your hosting provider for help with this process.

NOTE: Please ensure "/public_root/includes/configure.php" and "/public_root/includes/your_admin_folder/configure.php" refer to "http://gelcandlecompany.com/" and "/public_root/wholesale/includes/configure.php" and "/public_root/wholesale/includes/your_admin_folder/configure.php" refer to "http://gelcandleswholesale.com/".

spawnie69:

My apologies, I to placed quotes in Dreamweaver but I guess it didn't work right. ...
This forum does not allow HTML. When posting / replying, a JavaScript editor is loaded (and provides buttons to: apply formatting such as bold / italic, wrap content with code tags, create bullets, etc. Keep in mind the editor works best on a desktop, laptop, or tablet (as opposed to a phone).

Okay, onto the .htaccess files.
Can you try the following and see what happens (keep a backup of your originals)?

"/public_html/.htaccess":

###############################################################################
# Add custom headers and options
###############################################################################
# Notes:
#
# Examples: Adding IE compatibility / edge flags, language and encoding flags,
# php or suphp directives, configure other Apache modules such as page_speed,
# and enable or disable Apache httpd options.
#
# Do NOT configure anything directly relating to physical or virtual resources
# in this section. These should be addressed later on in this file.
###############################################################################
#Options -Indexes

# Use PHP52CGI as default
AddHandler fcgid-script .php

###############################################################################
# Enable mod_rewrite processing using the rules in this .htaccess file
###############################################################################
# Notes:
#
# <IfModule> should be avoided at all costs. If mod_rewrite is not available
# it is almost always better to return HTTP 500 status. This way one can see
# there is an issue as soon as the .htaccess file is uploaded.
#
# For mod_rewrite to work, the Apache server option to allow symbolic links to
# be followed must be enabled. Most providers supporting mod_rewrite will
# have it enabled by default. If rewrite rules are not working one can see if
# enabling symbolic links fixes the issue by un-commenting the first directive
# below (Options +FollowSymLinks).
#
# When the MultiViews option is enabled, negotiation rules from mod_negotiation
# are applied prior to any mod_rewrite directives. This can cause unintended
# behavior. For example if the directory "/cms/" does not exist and the file
# "/cms.php" exists, a request for "/cms/someimage.jpg" will be transformed
# internally by mod_negotiation to "/cms.php/someimage.jpg". To disable
# MultiViews un-comment the second directive below (Options -MultiViews).
#
# Don't forget, mod_rewrite directives are processed in order until a matching
# RewriteRule with the [L] flag is encountered. So the more specific a rule is
# the closer it should appear to the top of this file.
###############################################################################
#Options +FollowSymLinks
#Options -MultiViews
RewriteEngine on

###############################################################################
# Tell mod_rewrite where this file is relative to the server document_root
###############################################################################
# Notes:
#
# This directive should only be enabled if this .htaccess file is not placed
# in the document_root (usually public_html, www, or web) of the (sub)domain.
#
# An easy way to determine the location relative to the server document_root is
# to look at the URL used to access a file in this folder. For example if you
# access a "page" in the same folder as this file by typing in the URL
# "www.mydomain.com/myfolder/index.html" then "myfolder" will be the location
# of this file relative to the server document_root.
#
# Another quick and easy way to determine the correct setting for this is to
# look at the defined value for DIR_WS_CATALOG and DIR_WS_HTTPS_CATALOG in
# Zen Cart's configure.php files. All three values should match.
#
# Don't forget the leading and trailing /. This directive requires both!
###############################################################################
#RewriteBase /shop/

###############################################################################
# Redirect if request was for index.php (no query)
###############################################################################
# Notes:
#
# This is only required if the site generates references to index.php with no
# parameters. This rule will force a 301 redirect to the site root when a
# request is made for "/index.php" with no query terms (?key=value).
###############################################################################
#RewriteCond %{QUERY_STRING} ^$
#RewriteRule ^index\.php$ / [R=301,L]

###############################################################################
# Add any custom 301 redirects
###############################################################################
# Notes:
#
# In general these should be few and far between. If you use a RewriteRule
# be sure to add the L flag to let Apache mod_rewrite know to stop processing
# and skip any RewriteRules defined later in the .htaccess file.
###############################################################################


###############################################################################
# Redirect if request was for index.php (with or without query)
###############################################################################
# Notes:
#
# This is a performance optimization. If the request is for index.php simply
# pass the request on and do not process any other mod_rewrite directives in
# this file.
#
# Basically this avoids the overhead of checking if index.php is a real file
# or directory (used in subsequent mod_rewrite rules) before sending the
# request to index.php.
###############################################################################
RewriteRule ^index\.php$ - [L]

###############################################################################
# Start Ultimate (SEO) URLs
###############################################################################
# Notes:
#
# You should not make any changes in this section unless you really understand
# how it will impact your web site. Mistakes can break things.
###############################################################################

# If the URI starts with "wholesale", skip the next 12 RewriteRule directives
RewriteRule ^wholesale(/|$) - [S=12]

# Handles the new URL formats
RewriteRule ^(.*)-c-([0-9_]+)/(.*)-p-([0-9]+)(.*)$ index\.php?main_page=product_info&products_id=$4&cPath=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-c-([0-9_]+)/(.*)-pi-([0-9]+)(.*)$ index\.php?main_page=popup_image&pID=$4&cPath=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-c-([0-9_]+)/(.*)-pr-([0-9]+)(.*)$ index\.php?main_page=product_reviews&products_id=$4&cPath=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-c-([0-9_]+)/(.*)-pri-([0-9]+)(.*)$ index\.php?main_page=product_reviews_info&products_id=$4&cPath=$2&%{QUERY_STRING} [L]

# Original (unchanged) URL formats
RewriteRule ^(.*)-p-([0-9]+)(.*)$ index\.php?main_page=product_info&products_id=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-m-([0-9]+)(.*)$ index\.php?main_page=index&manufacturers_id=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-pi-([0-9]+)(.*)$ index\.php?main_page=popup_image&pID=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-pr-([0-9]+)(.*)$ index\.php?main_page=product_reviews&products_id=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-pri-([0-9]+)(.*)$ index\.php?main_page=product_reviews_info&products_id=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-ezp-([0-9]+)(.*)$ index\.php?main_page=page&id=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-c-([0-9_]+)(.*)$ index\.php?main_page=index&cPath=$2&%{QUERY_STRING} [L]

# Rewrite all other requests (if the file / directory does not exist)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?main_page=$1&%{QUERY_STRING} [L]

###############################################################################
# Add any other directives relating to the handling of physical files
###############################################################################
# Notes:
#
# If processing makes it this far, the request was for a real file or folder.
# Example: Adding further processing related to browser caching or security.
###############################################################################

"/public_html/wholesale/.htaccess":

###############################################################################
# Add custom headers and options
###############################################################################
# Notes:
#
# Examples: Adding IE compatibility / edge flags, language and encoding flags,
# php or suphp directives, configure other Apache modules such as page_speed,
# and enable or disable Apache httpd options.
#
# Do NOT configure anything directly relating to physical or virtual resources
# in this section. These should be addressed later on in this file.
###############################################################################
#Options -Indexes

###############################################################################
# Enable mod_rewrite processing using the rules in this .htaccess file
###############################################################################
# Notes:
#
# <IfModule> should be avoided at all costs. If mod_rewrite is not available
# it is almost always better to return HTTP 500 status. This way one can see
# there is an issue as soon as the .htaccess file is uploaded.
#
# For mod_rewrite to work, the Apache server option to allow symbolic links to
# be followed must be enabled. Most providers supporting mod_rewrite will
# have it enabled by default. If rewrite rules are not working one can see if
# enabling symbolic links fixes the issue by un-commenting the first directive
# below (Options +FollowSymLinks).
#
# When the MultiViews option is enabled, negotiation rules from mod_negotiation
# are applied prior to any mod_rewrite directives. This can cause unintended
# behavior. For example if the directory "/cms/" does not exist and the file
# "/cms.php" exists, a request for "/cms/someimage.jpg" will be transformed
# internally by mod_negotiation to "/cms.php/someimage.jpg". To disable
# MultiViews un-comment the second directive below (Options -MultiViews).
#
# Don't forget, mod_rewrite directives are processed in order until a matching
# RewriteRule with the [L] flag is encountered. So the more specific a rule is
# the closer it should appear to the top of this file.
###############################################################################
#Options +FollowSymLinks
#Options -MultiViews
RewriteEngine on

###############################################################################
# Tell mod_rewrite where this file is relative to the server document_root
###############################################################################
# Notes:
#
# This directive should only be enabled if this .htaccess file is not placed
# in the document_root (usually public_html, www, or web) of the (sub)domain.
#
# An easy way to determine the location relative to the server document_root is
# to look at the URL used to access a file in this folder. For example if you
# access a "page" in the same folder as this file by typing in the URL
# "www.mydomain.com/myfolder/index.html" then "myfolder" will be the location
# of this file relative to the server document_root.
#
# Another quick and easy way to determine the correct setting for this is to
# look at the defined value for DIR_WS_CATALOG and DIR_WS_HTTPS_CATALOG in
# Zen Cart's configure.php files. All three values should match.
#
# Don't forget the leading and trailing /. This directive requires both!
###############################################################################
RewriteBase /wholesale/

###############################################################################
# Redirect if request was for index.php (no query)
###############################################################################
# Notes:
#
# This is only required if the site generates references to index.php with no
# parameters. This rule will force a 301 redirect to the site root when a
# request is made for "/index.php" with no query terms (?key=value).
###############################################################################
#RewriteCond %{QUERY_STRING} ^$
#RewriteRule ^index\.php$ / [R=301,L]

###############################################################################
# Add any custom 301 redirects
###############################################################################
# Notes:
#
# In general these should be few and far between. If you use a RewriteRule
# be sure to add the L flag to let Apache mod_rewrite know to stop processing
# and skip any RewriteRules defined later in the .htaccess file.
###############################################################################


###############################################################################
# Redirect if request was for index.php (with or without query)
###############################################################################
# Notes:
#
# This is a performance optimization. If the request is for index.php simply
# pass the request on and do not process any other mod_rewrite directives in
# this file.
#
# Basically this avoids the overhead of checking if index.php is a real file
# or directory (used in subsequent mod_rewrite rules) before sending the
# request to index.php.
###############################################################################
RewriteRule ^index\.php$ - [L]

###############################################################################
# Start Ultimate (SEO) URLs
###############################################################################
# Notes:
#
# You should not make any changes in this section unless you really understand
# how it will impact your web site. Mistakes can break things.
###############################################################################

# Handles the new URL formats
RewriteRule ^(.*)-c-([0-9_]+)/(.*)-p-([0-9]+)(.*)$ index\.php?main_page=product_info&products_id=$4&cPath=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-c-([0-9_]+)/(.*)-pi-([0-9]+)(.*)$ index\.php?main_page=popup_image&pID=$4&cPath=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-c-([0-9_]+)/(.*)-pr-([0-9]+)(.*)$ index\.php?main_page=product_reviews&products_id=$4&cPath=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-c-([0-9_]+)/(.*)-pri-([0-9]+)(.*)$ index\.php?main_page=product_reviews_info&products_id=$4&cPath=$2&%{QUERY_STRING} [L]

# Original (unchanged) URL formats
RewriteRule ^(.*)-p-([0-9]+)(.*)$ index\.php?main_page=product_info&products_id=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-m-([0-9]+)(.*)$ index\.php?main_page=index&manufacturers_id=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-pi-([0-9]+)(.*)$ index\.php?main_page=popup_image&pID=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-pr-([0-9]+)(.*)$ index\.php?main_page=product_reviews&products_id=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-pri-([0-9]+)(.*)$ index\.php?main_page=product_reviews_info&products_id=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-ezp-([0-9]+)(.*)$ index\.php?main_page=page&id=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-c-([0-9_]+)(.*)$ index\.php?main_page=index&cPath=$2&%{QUERY_STRING} [L]

# Rewrite all other requests (if the file / directory does not exist)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?main_page=$1&%{QUERY_STRING} [L]

###############################################################################
# Add any other directives relating to the handling of physical files
###############################################################################
# Notes:
#
# If processing makes it this far, the request was for a real file or folder.
# Example: Adding further processing related to browser caching or security.
###############################################################################

NOTE: For the purists, yes the above could be combined into one main .htaccess in the web server document root. They have been kept separate for readability, portability, and ease of use / understanding. Some duplicate code is also present to handle a wider range of Apache server configurations (and may not be needed in both files depending upon the server configuration). The rules could also be applied directly to a VirtualHost block if hosted on a VPS or a dedicated server for slightly better performance.

22 May 2015, 4:58 PM
#17
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,779
Plugin Contributions:
11

Re: After Upgrade Contact Us page Redirect Loop Error

Not as bad as using Word but, both should not be used to create/edit files for Zen Cart.Neither is advised. Use something like notepad or notepad+. If you have a little money to spend, I use UltraEdit which combines FTP and proper file editing.

22 May 2015, 6:28 PM
#18
spawnie69 avatar

spawnie69

Totally Zenned

Join Date:
Sep 2005
Location:
Ocala, FL
Posts:
527
Plugin Contributions:
0

Re: After Upgrade Contact Us page Redirect Loop Error

I meant to say notepad, will do . thank you for sharing that info. you guys are awesome!

22 May 2015, 7:46 PM
#19
spawnie69 avatar

spawnie69

Totally Zenned

Join Date:
Sep 2005
Location:
Ocala, FL
Posts:
527
Plugin Contributions:
0

Re: After Upgrade Contact Us page Redirect Loop Error

[QUOTE=lhungil;1282801]Sounds like you may have alternative URL plugins installed in both stores... And may have mixed versions of the alternative URL plugin installed in the same store (or a different plugin installed?)...

Yes, the https://www.gelcandlecompany.com is our retail site with zc 1.39h running the old version of SEO urls aka Ultimate URLS
and the wholesale site https://www.gelcandleswholesale.com is the upgraded zc 1.54 running the currently upgraded Ultimate Urls ver 2.15.

The admin menu configuration has not been labelled as "SEO URLs" for quite a long time... Yet the .htaccess file contents you posted are from a recent version of Ultimate URLs... If both sites are running Zen Cart 1.3.9h or newer, you may want to first remove the older plugin(s) and upgrade both sites to the latest version of Ultimate URLs (don't forget to apply all relevant patches to Zen Cart and Ultimate URLs).

I attempted the upgraded and failed as you foreseen due to the following:

Warning The version of Zen Cart's mysql query_factory has a known bug present and you have enabled Zen Cart's SQL Cache. Either patch the bug or set define('SQL_CACHE_METHOD', 'none'); in your Zen Cart configure.php files.
Error Ultimate URLs installation / upgrade failed!

If your hosting provider is still running PHP 5.2, I would highly recommend upgrading to PHP 5.4 as soon as feasible (keep in mind the Zen Cart server requirements depending on the versions of Zen Cart you have installed). You may need to contact your hosting provider for help with this process.

My host is bluehost and I am able to change the php via cpanel and I switch from 5.2 to 5.4 for the time being to get into 1.54 admin.

NOTE: Please ensure "/public_root/includes/configure.php" and "/public_root/includes/your_admin_folder/configure.php" refer to "http://gelcandlecompany.com/" and "/public_root/wholesale/includes/configure.php" and "/public_root/wholesale/includes/your_admin_folder/configure.php" refer to "http://gelcandleswholesale.com/".

gelcandlecompany.com configure file all refers to gelcandlecompany.com

on the other hand gelcandleswholesale.com configure file says:

define('HTTP_SERVER', 'http://gelcandleswholesale.com');
define('HTTPS_SERVER', 'https://gelcandlecompany.com');
define('ENABLE_SSL', 'true');
define('DIR_WS_CATALOG', '/');
define('DIR_WS_HTTPS_CATALOG', '/wholesale/');

define('HTTP_SERVER', 'http://gelcandlecompany.com');
define('HTTPS_SERVER', 'https://gelcandlecompany.com');
define('HTTP_CATALOG_SERVER', 'http://gelcandlecompany.com');
define('HTTPS_CATALOG_SERVER', 'https://gelcandlecompany.com');

This sub-folder configuration seemed to have worked for me for years. hope its right, orders came through ok. lol.