Cant login after .htaccess redirect

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
JaymeNYC
Forum Members
Forum Members
Posts: 53
Joined: Sat Aug 30, 2008 8:30 pm

Cant login after .htaccess redirect

Post by JaymeNYC »

I redirected "site.com" to "www.site.com" and now It won't let me log in.. is there anyway to fix this?
JaymeNYC
Forum Members
Forum Members
Posts: 53
Joined: Sat Aug 30, 2008 8:30 pm

Re: Cant login after .htaccess redirect

Post by JaymeNYC »

I tried clearing cookies and also the cache and it still doesn't work.

My htaccess file

Code: Select all

Options -Indexes
Options +FollowSymLinks
RewriteEngine on
RewriteBase /



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

# Rewrites urls in the form of /parent/child/
# but only rewrites if the requested URL is not a file or directory
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ index.php?page=$1 [QSA]
Pierre M.

Re: Cant login after .htaccess redirect

Post by Pierre M. »

Hmmm... not CMSms specific... shouldn't be asked in these forums but on Apache's.

RewriteCond %{HTTP_HOST} ^site\.net$ [NC]
is my suspect.

I'd rather
RewriteCond %{HTTP_HOST} !www\.site\.net$ [NC]

Pierre M.
JaymeNYC
Forum Members
Forum Members
Posts: 53
Joined: Sat Aug 30, 2008 8:30 pm

Re: Cant login after .htaccess redirect

Post by JaymeNYC »

Thx 4 the help Pierre! I changed it to what you suggested and still doesn't work..  :(  Is there something else other than the htaccess I should change that will help me with this? Maybe an admin file or something in the config.php file?  I've tried logging in with computers that never accessed my site so there shouldnt be any problems with cache/cookies which is what I thought the problem was.
Pierre M.

Re: Cant login after .htaccess redirect

Post by Pierre M. »

Try Apache's Rewritelog.
zircle
New Member
New Member
Posts: 2
Joined: Mon Oct 20, 2008 5:25 pm

Re: Cant login after .htaccess redirect

Post by zircle »

I had the same problem, i solved it by editing one line in the config.php file.

At approximately line 74 (at least it was in my config.php file), i changed the follwing:

Code: Select all

$config['root_url'] = 'http://site.net';
to:

Code: Select all

$config['root_url'] = 'http://www.site.net';
afterwards i could login again  ;D
Pierre M.

Re: Cant login after .htaccess redirect

Post by Pierre M. »

Yes, when you somewhat "move" the site you must reflect the changes in the config.php.
Pierre M.
Post Reply

Return to “CMSMS Core”