Results 1 to 8 of 8
  1. #1
    Join Date
    May 2009
    Location
    Longmont, CO
    Posts
    91
    Plugin Contributions
    0

    Default Cant login to admin after 301 redirect htaccess

    Cant login to admin after 301 redirect htaccess.

    Options +FollowSymlinks
    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^angiejolee.com
    RewriteRule ^(.*)$ http://www.angiejolee.com/$1 [R=301,L]
    RewriteCond %{REQUEST_URI} !^/?store
    RewriteCond %{REQUEST_URI} !^/?gallery2
    RewriteCond %{REQUEST_URI} !^/?gallery3
    RewriteCond %{REQUEST_URI} !^/?gallery4
    RewriteCond %{REQUEST_URI} !^/?gallery5
    RewriteRule ^(.+)?$ /store/ [QSA,R=301]


    Someone suggested in another thread adding www. to the domain in admin/configure.php but that didnt work, in fact with this change, I could not login even without the above redirect.

    Anybody know how to fix this popular topic?
    Thanks
    Drunkguy

  2. #2
    Join Date
    Aug 2009
    Posts
    1
    Plugin Contributions
    0

    Default Re: Cant login to admin after 301 redirect htaccess

    I'm having the same issue. I can't access admin once this redirection happens.

    Any help?

  3. #3
    Join Date
    May 2009
    Location
    Longmont, CO
    Posts
    91
    Plugin Contributions
    0

    Default Re: Cant login to admin after 301 redirect htaccess

    If your htaccess file looks like this, rewriting urls to www. then:
    Options +FollowSymlinks
    RewriteEngine on
    RewriteCond %{HTTP_HOST} !^www
    RewriteRule (.*) http://www.%{HTTP_HOST}/$1 [L,R=301]

    Look at your configure.php file in admin/includes and add "www." in front of the domain name. That alone might fix admin login.

    I also did the same thing to configure.php file in /includes just to be safe.

    Lastly, I made sure I was not following a bookmark to the login php file that might have a cookie set with session data or something.

    Thats what fixed it for me.

  4. #4
    Join Date
    Aug 2009
    Location
    UK
    Posts
    71
    Plugin Contributions
    0

    Default Re: Cant login to admin after 301 redirect htaccess

    I have the same problen logging into admin after putting in the 301 redirect from non-www to www.

    Code added to htaccess:-

    RewriteCond %{HTTP_HOST} !^www\.saving-light-bulbs\.co.uk$
    RewriteRule (.*) http://www.saving-light-bulbs.co.uk/$1 [R=301,L]

    I have in the config file
    define('HTTP_SERVER', 'http://www.saving-light-bulbs.co.uk');
    define('HTTPS_SERVER', 'https://pegasus.terrassl.net/~saving');

    and in admin config
    define('HTTP_SERVER', 'https://pegasus.terrassl.net/~saving');
    define('HTTPS_SERVER', 'https://pegasus.terrassl.net/~saving');
    define('HTTP_CATALOG_SERVER', 'https://pegasus.terrassl.net/~saving');
    define('HTTPS_CATALOG_SERVER', 'https://pegasus.terrassl.net/~saving');

    Does this look ok?
    Any ideas?

  5. #5
    Join Date
    Dec 2009
    Posts
    7
    Plugin Contributions
    0

    Default Re: Cant login to admin after 301 redirect htaccess

    Try this:
    add this to .htaccess in admin/
    Code:
    RewriteEngine Off
    Warning: do it at your own risk, I actually don't know yet the downside of the mods.

    this fixes mine, hopefully yours too.

  6. #6
    Join Date
    Aug 2009
    Location
    UK
    Posts
    71
    Plugin Contributions
    0

    Default Re: Cant login to admin after 301 redirect htaccess

    I tried
    RewriteEngine Off
    in the admin htaccess and it solved the problem of getting into admin BUT admin, checkout and login were no longer directed to SSL!!!!
    any other ideas?

  7. #7
    Join Date
    Aug 2009
    Location
    UK
    Posts
    71
    Plugin Contributions
    0

    Default Re: Cant login to admin after 301 redirect htaccess

    I've fixed this now by using slightly different rewrite code in the htaccess file

    I used :
    RewriteCond %{HTTP_HOST} ^saving-light-bulbs.co.uk [NC]
    RewriteRule ^(.*)$ http://www.saving-light-bulbs.co.uk/$1 [L,R=301]

    for the site : www.saving-light-bulbs.co.uk

    I found the information here http://www.seobook.com/archives/001714.shtml

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

    Default Re: Cant login to admin after 301 redirect htaccess

    To prevent confusion for those reading this thread at a later date, the following is what one can use for adding or removing the 'www' in the URL.

    Make sure to change 'yourdomain.com' to your Domain name.

    You can only use one or the other, do not use both.


    RewriteEngine ON

    ## removes www from Browser URL
    RewriteCond %{HTTP_HOST} ^www.yourdomain.com [NC]
    RewriteRule ^(.*) http://yourdomain.com/$1 [R=301,L]

    or...

    RewriteEngine ON

    ## adds www to Browser URL
    RewriteCond %{HTTP_HOST} ^yourdomain.com [NC]
    RewriteRule ^(.*) http://www.yourdomain.com/$1 [R=301,L]


    Copy & paste whichever you prefer and put the code at the top of your .htaccess file, for easy reference.

    Also, always make sure to immediately test any changes to your .htaccess file. If something within it is incorrect your site will not be accessible.

 

 

Similar Threads

  1. Cannot login after setting 301 redirect in htacccess file
    By RalphStirrat in forum Upgrading from 1.3.x to 1.3.9
    Replies: 27
    Last Post: 11 May 2012, 02:10 AM
  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. Replies: 1
    Last Post: 3 Sep 2008, 07:48 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