Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1
    Join Date
    Jul 2017
    Location
    United States
    Posts
    10
    Plugin Contributions
    0

    Default Admin login not working when SSL redirect is in place

    Hello Zen Cart Forum,

    I did a fresh install of Zen Cart 1.5.5e. Added a template from Template Monster. Just got the SSL processed through Go Daddy. Confirmed that the https url was functioning. Added the code to the two configure files (includes/configure.php and admin/includes/configure.php) and the redirect to the htaccess file. Initially the layout on the homepage was messed up but once I added the proper code to the includes/configure.php file it layed out properly however when I go to log in to the admin it won't allow me to log in. I removed the htaccess redirect and I'm able to log in to the admin and access the secure admin. So it does exist, I just can't access it when the redirect is in place.
    Here is the code I added to the admin/includes/configure.php file.
    define('HTTP_SERVER', 'https://www.example.com');

    define('HTTP_CATALOG_SERVER', 'http:/www.example.com');
    define('HTTPS_CATALOG_SERVER', 'https://www.example.com');

    define('ENABLE_SSL_CATALOG', 'true');

    I read this page many times, https://www.zen-cart.com/content.php...alled-zen-cart.

    Also I read some other posts and tried many different ways but nothing seems to work.

    Any help would be much appreciated.

    thank you,
    Tre

  2. #2
    Join Date
    Jan 2007
    Posts
    1,484
    Plugin Contributions
    10

    Default Re: Admin login not working when SSL redirect is in place

    What redirect are you adding to the htaccess file? Is this for a URL rewriter?

    Zen Cart and it's community are the best!!

  3. #3
    Join Date
    Jul 2012
    Posts
    16,734
    Plugin Contributions
    17

    Default Re: Admin login not working when SSL redirect is in place

    If you are trying to make all pages https: then it would help ZC if all uris that it tries to use are also https:, otherwise might find the system in some sort of loop and possibly cause issues.

    Therefore HTTP_CATALOG_SERVER would need to be updated to include https:

    Beyond that, please answer lankeeyankee's question as well as identifying "other" things tried. The more information that is presented, the easier it is to help and the easier someone else may find a solution for their own similar/related problem.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

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

    Default Re: Admin login not working when SSL redirect is in place

    I agree: it seems incorrect .htaccess redirect is being used.
    .

    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
    Jul 2017
    Location
    United States
    Posts
    10
    Plugin Contributions
    0

    Default Re: Admin login not working when SSL redirect is in place

    Hey guys,

    Thanks for the reply's.

    Here is the redirect code Godaddy sent me to add to the .htaccess file.

    RewriteEngine On
    RewriteCond %{HTTPS} off
    RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

    If I remove it then a user can access the non secure site and won't be redirected to the secure server.

    thanks,
    Tre

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

    Default Re: Admin login not working when SSL redirect is in place

    If that's what GoDaddy is telling you to add, then they should be capable of addressing why it's not working. Ask them to support it.

    Zen Cart doesn't do anything special here. It just simply generates the URL as per the configure.php contents, and expects to be able to set and read a cookie for the same URL. Very straightforward, standard procedure for any application.
    .

    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.

  7. #7
    Join Date
    Jul 2017
    Location
    United States
    Posts
    10
    Plugin Contributions
    0

    Default Re: Admin login not working when SSL redirect is in place

    I already contacted GoDaddy customer support about this issue a few times and they said that they don't do support for Zen Cart and that I should be able to get support from the Zen Cart forum.

    If I remove the redirect then how do I activate just a secure checkout?

  8. #8
    Join Date
    Oct 2006
    Location
    Alberta, Canada
    Posts
    4,571
    Plugin Contributions
    1

    Default Re: Admin login not working when SSL redirect is in place

    The following should help in what you what to achieve.

    1. In both config files make sure to use:

    define('HTTP_CATALOG_SERVER', 'https:/www.example.com');


    2. Admin -> Configuration -> Sessions
    Cookie Domain
    Force Cookie Use
    - make sure they both say True


    3. Add the following at the top of you .htaccess file
    Code:
    #############################
    ##  General Settings
    
    Options  +SymLinksIfOwnerMatch -FollowSymlinks -Indexes
    
    RewriteEngine ON
    
    # Define the default Character Set for Browsers
    AddDefaultCharset utf-8
    
    # if an https URL is not used then redirect to use https
    RewriteCond %{SERVER_PORT} 80
    RewriteRule ^(.*)$ https://www.example.com/$1 [R=301,L]
    
    # regardless of whether an https URL is used,
    # if a URL is used without www then redirect to an https URL that does use www
    RewriteCond %{HTTP_HOST} ^example.com [NC]
    RewriteRule ^(.*)$ https://www.example.com/$1 [R=301,L]
    Note that "example.com" should be changed to your Domain name.

  9. #9
    Join Date
    Jul 2017
    Location
    United States
    Posts
    10
    Plugin Contributions
    0

    Default Re: Admin login not working when SSL redirect is in place

    Thanks Website Rob for the very thorough answer. I added what you suggested but I still can't log into the secure admin.

    Also thanks DrByte. I contacted GoDaddy once more and they confirmed that the issue was in the htaccess file and that they could fix it for a small fee.

    Here is the relevant code I have on the three pages. Maybe you can see something that I'm missing.

    includes/configure.php
    Code:
    define('HTTP_SERVER', 'http://www.example.com');
    define('HTTPS_SERVER', 'https://www.example.com');
    
    define('ENABLE_SSL', 'true');
    
    define('HTTP_CATALOG_SERVER', 'https:/www.example.com');
    define('DIR_WS_CATALOG', '/');
    define('DIR_WS_HTTPS_CATALOG', '/');
    admin/includes/configure.php
    Code:
    define('HTTP_CATALOG_SERVER', 'https:/www.example.com');
    define('HTTPS_CATALOG_SERVER', 'https://www.example.com');
    
    define('ENABLE_SSL_CATALOG', 'true');
    
    define('DIR_WS_CATALOG', '/');
    define('DIR_WS_HTTPS_CATALOG', '/');
    .htaccess
    Code:
    #############################
    ##  General Settings
    
    Options  +SymLinksIfOwnerMatch -FollowSymlinks -Indexes
    
    RewriteEngine ON
    
    # Define the default Character Set for Browsers
    AddDefaultCharset utf-8
    
    # if an https URL is not used then redirect to use https
    RewriteCond %{SERVER_PORT} 80
    RewriteRule ^(.*)$ https://www.example.com/$1 [R=301,L]
    
    # regardless of whether an https URL is used,
    # if a URL is used without www then redirect to an https URL that does use www
    RewriteCond %{HTTP_HOST} ^example.com [NC]
    RewriteRule ^(.*)$ https://www.example.com/$1 [R=301,L]
    
    RewriteEngine On
    RewriteCond %{HTTPS} off
    RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

  10. #10
    Join Date
    Oct 2006
    Location
    Alberta, Canada
    Posts
    4,571
    Plugin Contributions
    1

    Default Re: Admin login not working when SSL redirect is in place

    Remove this from your .htaccess file.

    RewriteEngine On
    RewriteCond %{HTTPS} off
    RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]


    Change to this in: includes/configure.php


    define('HTTP_SERVER', 'https://www.example.com');
    Last edited by Website Rob; 2 Aug 2017 at 08:44 AM.

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. v139h Admin links return to login page when SSL enabled
    By Kromak in forum General Questions
    Replies: 4
    Last Post: 21 Nov 2012, 06:48 PM
  2. Replies: 8
    Last Post: 11 Oct 2012, 12:21 AM
  3. SSL is on, but http:// login page does not redirect to https://
    By jackie.taferner in forum Basic Configuration
    Replies: 17
    Last Post: 16 Jun 2011, 04:53 PM
  4. Replies: 8
    Last Post: 3 Jul 2010, 02:53 AM
  5. Replies: 5
    Last Post: 23 Jun 2010, 12:39 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