Results 1 to 5 of 5
  1. #1
    Join Date
    Nov 2011
    Posts
    7
    Plugin Contributions
    0

    Default Admin URL - Can't Login With Forced WWW vs Non-WWW via .htacces

    Hello all,

    I couldn't find this on Google or searching through here so here's my post.

    I have a freshly installed Zen Cart, everything works fine except for logging into the admin area when I have my site with www forced via the .htaccess file. Once I disable the forced www I can log in and then re-enable it and everything is fine.

    It's a work around but I'd prefer not to have to do that.

    Thinking that the admin URLs use a forced non-www and are producing a conflict, I added www to the configure.php file within the includes and adminurl/includes directories. That didn't fix it either.

    Would anyone have any other thoughts? Any help would be appreciated!

  2. #2
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Admin URL - Can't Login With Forced WWW vs Non-WWW via .htacces

    Sounds like your .htaccess rewrite rules are incorrect.

    The best place to start is to include the www. in your HTTP_SERVER and HTTPS_SERVER settings in your configure.php files. In that case it's basically unnecessary to do any redirects with .htaccess, because Zen Cart handles the correct URL generation for you the rest of the time, including telling search engines to always look at the www. version only.
    .

    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.

  3. #3
    Join Date
    Nov 2011
    Posts
    7
    Plugin Contributions
    0

    Default Re: Admin URL - Can't Login With Forced WWW vs Non-WWW via .htacces

    Thanks for the response, normally I'd agree but this case is a little more particular.

    Zen Cart is installed in a sub directory off the main site. The main site has been around for about a decade and has a bunch of links that are both www and non-www so forcing www on all http requests ensures everything is uniform for canonical (SEO) purposes.

    Unfortunately I already entered the www is in the both of the configure.php files but something in the script is still going to a non-www something or other and can't process the admin login area.

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

    Default Re: Admin URL - Can't Login With Forced WWW vs Non-WWW via .htacces

    Zen Cart only uses the configure.php information to build its URLs.

    So, I respectfully submit that your problem is with the rules in your .htaccess. They must not be correct.
    .

    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
    Nov 2011
    Posts
    7
    Plugin Contributions
    0

    Default Re: Admin URL - Can't Login With Forced WWW vs Non-WWW via .htacces

    In fact this was a permissions issue after I looked into it more.

    Both configure.php files were not overwriting with the updated files that included the "www." entries. So my earlier statement that I had edited those already was technically incorrect.

    I had to change the permissions on them both and was able to upload the edited files without issue.

    Now everything works perfectly with the original htaccess.

    Thanks!
    Last edited by zywex; 29 Feb 2012 at 09:08 PM. Reason: Forgot to say thanks

 

 

Similar Threads

  1. v139h Can't Login With Forced WWW vs Non-WWW via .htacces
    By KeithZ in forum General Questions
    Replies: 7
    Last Post: 3 Jun 2012, 07:14 AM
  2. www. vs non-www. affecting login page
    By WriteAtHome in forum General Questions
    Replies: 0
    Last Post: 20 Apr 2011, 08:39 PM

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