I am getting errors for too many redirects in Yii.
I am using the default accessControl filter provided by Yii.
The whole application works perfectly on localhost, where i am using WAMP. The problem started occuring after i uploaded to a staging server.
I have configured the .htaccess file to the best of my knowledge
Options +FollowSymLinks
IndexIgnore */*
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^.*$ /index.php [L]
</IfModule>
If i try to open any action where login is not required it opens without a glitch
public function accessRules()
{
return array(
array('allow', // allow all users to perform 'index' and 'view' actions
'actions' => array('index', 'locationImport', 'contact'),
'users' => array('*'),
),
array('allow', // allow authenticated user to perform 'create' and 'update' actions
'actions' => array('LocationImport'),
'users' => array('@'),
),
array('allow', // allow admin user to perform 'admin' and 'delete' actions
'actions' => array('admin', 'delete'),
'users' => array('admin'),
),
array('deny', // deny all users
'users' => array('*'),
),
);
}
In the above controller the contact is working.
my main.php relevant
'user' => array(
// enable cookie-based authentication
'allowAutoLogin' => true,
'loginUrl' => array('/useraccount/login'),
'class' => 'CPWebUser',
),
Access rules in UserAccountController
public function accessRules()
{
return array(
array('allow', // allow all users to perform 'register' and 'login' actions
'actions' => array('register', 'login', 'view', 'xxxx', 'xxxx',),
'users' => array('*'),
),
array('allow', // allow authenticated user to perform 'create' and 'update' actions
'actions' => array('update', 'logout', 'home', 'changePassword'),
'users' => array('@'),
)
array('deny', // deny all users
'users' => array('*'),
),
);
}
Just to sum up. completely works on localhost. sitecontroller Actioncontact works. No action in userAccountController works. Not even register, it redirects to login. actionLogin doesnt open.