Forums / Installing on a Linux/Unix Server / Help with .htacess and configure files to stop SSL redirect loop

Help with .htacess and configure files to stop SSL redirect loop

Locked

Started by behrtek on 5 Mar 2009, 2:25 AM · Views: 3,421

Results 1 to 8 of 8
This thread is locked. New replies are disabled.
5 Mar 2009, 2:25 AM
#1
behrtek avatar

behrtek

New Zenner

Join Date:
Mar 2008
Posts:
10
Plugin Contributions:
0

Help with .htacess and configure files to stop SSL redirect loop

Hi, I have searched and searched this forum and faqs and google, etc.. and I cannot seem to get the SSL issued ironed out. I have called my host and they claim all is well.

Store: https://www.charlestonbatcompany.net/cbcstore

zencart 1.38a hosted at 1n1 on linux server

Originally installed without SSL then had that installed, it is supposed to be a dedicated SSL.

The host had me upload a .htaccess file which contained:

RewriteEngine On
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^(.*)$ https://charlestonbatcompany.net/$1 [R]

So I changed my admin/includes configure file to:

define('HTTP_SERVER', 'http://www.charlestonbatcompany.net');
define('HTTPS_SERVER', 'https://charlestonbatcompany.net');
define('HTTP_CATALOG_SERVER', 'http://www.charlestonbatcompany.net');
define('HTTPS_CATALOG_SERVER', 'https://charlestonbatcompany.net');

// Use secure webserver for catalog module and/or admin areas?
define('ENABLE_SSL_CATALOG', 'true');
define('ENABLE_SSL_ADMIN', 'false');

and my includes configure file to:

define('HTTP_SERVER', 'http://www.charlestonbatcompany.net');
define('HTTPS_SERVER', 'https://charlestonbatcompany.net');

// Use secure webserver for checkout procedure?
define('ENABLE_SSL', 'true');

Which from what I understood should handle the redirect issue.

But when you attempt to login to the store, or checkout, or access the admin section, a redirect error is displayed.

Please tell me what I am doing wrong!

Is it something my host needs to do?

PS: Great software by the way, and yes I bought the book!

5 Mar 2009, 4:01 AM
#2
drbyte avatar

drbyte

Sensei

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

Re: Help with .htacess and configure files to stop SSL redirect loop

behrtek:

The host had me upload a .htaccess file which contained:

RewriteEngine On
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^(.*)$ https://charlestonbatcompany.net/$1 [R]Did they say WHY they suggested that? That doesn't seem to make sense.

behrtek:

So I changed my admin/includes configure file to:

define('HTTP_SERVER', 'http://www.charlestonbatcompany.net');
define('HTTPS_SERVER', 'https://charlestonbatcompany.net');
define('HTTP_CATALOG_SERVER', 'http://www.charlestonbatcompany.net');
define('HTTPS_CATALOG_SERVER', 'https://charlestonbatcompany.net');
If your SSL cert is registered to the domain name without the "www." prefix, then it would make sense to remove the "www." from the non-SSL URLs in your configure.php files too.

.
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 Mar 2009, 5:03 AM
#3
merlinpa1969 avatar

merlinpa1969

Totally Zenned

Join Date:
Mar 2004
Posts:
13,031
Plugin Contributions:
4

Re: Help with .htacess and configure files to stop SSL redirect loop

lose that junk from the htaccess file
just comment it out and see if it works

Zen cart PCI compliant Hosting

5 Mar 2009, 1:09 PM
#4
behrtek avatar

behrtek

New Zenner

Join Date:
Mar 2008
Posts:
10
Plugin Contributions:
0

Re: Help with .htacess and configure files to stop SSL redirect loop

Originally when they installed the SSL, if I typed in the https:// address I would get an invalid certificate error.

So I called them and adding the .htaccess file that I posted above is what they recommended.

Ok I now have removed the file all together but I still get a redirect loop error in firefox. IE7 just sits there.

Any other ideas?

Thanks for the responses by the way!

5 Mar 2009, 1:35 PM
#5
drbyte avatar

drbyte

Sensei

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

Re: Help with .htacess and configure files to stop SSL redirect loop

And what's your hosting company saying about this?

.
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 Mar 2009, 2:52 PM
#6
behrtek avatar

behrtek

New Zenner

Join Date:
Mar 2008
Posts:
10
Plugin Contributions:
0

Re: Help with .htacess and configure files to stop SSL redirect loop

They aren't being very helpful, I think there is a language issue!

I have learned my lessons with this host, I will not be getting anymore accounts with them.

I am at a loss at the moment.

5 Mar 2009, 3:01 PM
#7
behrtek avatar

behrtek

New Zenner

Join Date:
Mar 2008
Posts:
10
Plugin Contributions:
0

Re: Help with .htacess and configure files to stop SSL redirect loop

OK, for some reason Fireftp was not showing me the .htaccess file in the root folder on my host. Don't know if that is something they are blocking or what.
Either way I logged into the host control panel and deleted the .htaccess file that was not showing up in my ftp software.

It appears to work correctly now.

Thanks again for everyone's help.

5 Mar 2009, 7:35 PM
#8
drbyte avatar

drbyte

Sensei

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

Re: Help with .htacess and configure files to stop SSL redirect loop

Many FTP programs automatically hide any files that start with a "." because those are technically "hidden" files. Usually there's a preferences setting you can change to have them show.

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