Page 1 of 2 12 LastLast
Results 1 to 10 of 15
  1. #1
    Join Date
    Mar 2007
    Posts
    30
    Plugin Contributions
    0

    Default .htaccess redirect makes admin login fail

    We have a .htaccess redirect that redirects from domain.com to www.domain.com. For some reason, this causes us to be unable to log into the admin panel. Any idea why this might happen or how to fix it?

  2. #2
    Join Date
    Jan 2007
    Location
    Carlsbad, CA
    Posts
    158
    Plugin Contributions
    0

    Default Re: .htaccess redirect makes admin login fail

    what redirect are you using?
    -Buck

  3. #3
    Join Date
    Jan 2007
    Location
    Carlsbad, CA
    Posts
    158
    Plugin Contributions
    0

    Default Re: .htaccess redirect makes admin login fail

    you might try this...


    RewriteEngine on
    RewriteCond %{HTTP_HOST} !^www
    RewriteRule (.*) http://www.%{HTTP_HOST}/$1 [L,R=301]


    Good luck, hope this helps.
    -Buck

  4. #4
    Join Date
    Mar 2007
    Posts
    30
    Plugin Contributions
    0

    Default Re: .htaccess redirect makes admin login fail

    Wow, that was quick

    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^domain.com
    RewriteRule (.*) http://www.domain.com/$1 [R=301,L]

    Also, it's on a Linux server running the newest version of Zen.

  5. #5
    Join Date
    Jan 2007
    Location
    Carlsbad, CA
    Posts
    158
    Plugin Contributions
    0

    Default Re: .htaccess redirect makes admin login fail

    Cool! I hope that worked out for you. Post the results though so others know if it works.
    -Buck

  6. #6
    Join Date
    Mar 2007
    Posts
    30
    Plugin Contributions
    0

    Default Re: .htaccess redirect makes admin login fail

    The redirect works but it still blocks me from logging into the admin.

  7. #7
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: .htaccess redirect makes admin login fail

    Are you trying to enter your admin using the www. address or without?
    Is there any difference if you try each approach?
    What exact symptoms are you experiencing when you say "admin login fails"?
    .

    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.

  8. #8
    Join Date
    Apr 2007
    Location
    Herts. UK
    Posts
    890
    Plugin Contributions
    4

    Default Re: .htaccess redirect makes admin login fail

    Quote Originally Posted by jlknauff View Post
    The redirect works but it still blocks me from logging into the admin.
    Check your admin/includes/configure.php file. You might have the non-www version of your domain name in the HTTP_SERVER or HTTPS_SERVER defines. If so, changing it to the www version should fix the problem.

    Regards,
    Christian.

  9. #9
    Join Date
    Mar 2007
    Posts
    30
    Plugin Contributions
    0

    Default Re: .htaccess redirect makes admin login fail

    Quote Originally Posted by DrByte View Post
    Are you trying to enter your admin using the www. address or without?
    Is there any difference if you try each approach?
    What exact symptoms are you experiencing when you say "admin login fails"?
    With the www. If I got to it with out the www, it redirects to the www version.

    The symptoms are that the screen simply refreshes, but does nothing. The same thing happens if I try to resent the password.

    Quote Originally Posted by CJPinder View Post
    Check your admin/includes/configure.php file. You might have the non-www version of your domain name in the HTTP_SERVER or HTTPS_SERVER defines. If so, changing it to the www version should fix the problem.

    Regards,
    Christian.
    I checked those and they contain the www.

  10. #10
    Join Date
    Apr 2007
    Location
    Herts. UK
    Posts
    890
    Plugin Contributions
    4

    Default Re: .htaccess redirect makes admin login fail

    Quote Originally Posted by jlknauff View Post
    The symptoms are that the screen simply refreshes, but does nothing. The same thing happens if I try to resent the password.
    It could be having problems setting the cookie that holds the session id. Try clearing the cookies and cache in your browser.

    Regards,
    Christian.

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. v139h My recently-added .htaccess redirect rule is preventing admin login
    By joecooper in forum General Questions
    Replies: 6
    Last Post: 5 Mar 2012, 04:43 PM
  2. Can't login after adding a 301 redirect in .htaccess
    By eutopia in forum Basic Configuration
    Replies: 0
    Last Post: 11 Oct 2011, 02:27 AM
  3. Cant login to admin after 301 redirect htaccess
    By Drunkguy in forum Basic Configuration
    Replies: 7
    Last Post: 15 Jan 2010, 11:54 AM
  4. Replies: 1
    Last Post: 3 Sep 2008, 07:48 AM

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