Answer the question
In order to leave comments, you need to log in
How to fix admin panel in Yii?
Good afternoon. There was a problem with logging into the admin panel on Yii
The structure is as follows
app/
/framework
/protected
/admin
/controllers (для админки)
/modules
...
/controllers
/modules
...
index,php
admin.php
<?php
$yii = dirname(__FILE__) . '/framework/yiilite.php';
$frontendConfig = dirname(__FILE__) . '/protected/config/frontend.php';
defined('YII_DEBUG') or define('YII_DEBUG', true);
defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL', 3);
require_once($yii);
Yii::createWebApplication($frontendConfig)->run();
<?php
$yii = dirname(__FILE__) . '/framework/yii.php';
$backendConfig = dirname(__FILE__) . '/protected/admin/config/backend.php';
defined('YII_DEBUG') or define('YII_DEBUG', false);
defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL', 3);
require_once($yii);
Yii::createWebApplication($backendConfig)->run();
AddDefaultCharset UTF-8
IndexIgnore */*
RewriteEngine on
RewriteRule ^admin admin.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php
#ours develop ip
RewriteCond %{REMOTE_ADDR} !^77\.47\.225\.88
RewriteCond %{REMOTE_ADDR} !^46\.219\.23\.82
RewriteCond %{REMOTE_ADDR} !^46\.219\.23\.77
RewriteCond %{REMOTE_ADDR} !^91\.214\.84\.194
RewriteCond %{REMOTE_ADDR} !^178\.140\.85\.203
RewriteCond %{REMOTE_ADDR} !^85\.10\.200\.59
RewriteCond %{REMOTE_ADDR} !^77\.47\.130\.186
#RewriteRule ^(.*)$ http://blago-vest.org/
php_value error_reporting 1
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^(.*)$ http://%1 [R=301,L]
#RewriteCond %{HTTPS} off
#RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
php_value error_reporting 1
Answer the question
In order to leave comments, you need to log in
Try renaming .htaccess to .htaccess.bak and try without it (/admin.php and /index.php).
If it works, then you comment line by line / block by block and look for the problem.
I think you screwed something up there..
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question