Server deployment thinkphp3.1.3 has too many redirects

WBOY
Release: 2016-10-10 11:39:11
Original
1529 people have browsed it

Recently, a project needs to be migrated from window to linux. There is no problem when running locally. However, when testing on linux, when entering the background system (admin.php), an error message appears. There are too many redirects on the website.

The loading process is admin.php as the entry file, the index controller inherits baseAction, and baseAction has the following code

<code>class IndexAction extends BaseAction {

    public function index() {
    //indexAction.class.php
    }
 }
    
    
class BaseAction extends Action {
//BaseAction.class.php
   public function _initialize() {
        if (!$this->isLogin()) {
            $this->redirect('Home/Login/index');
        }
    }</code>
Copy after login

Code of Login controller

<code>class LoginAction extends Action {

    /**
     * 显示登录页面
     */
    public function index() {
        if (!empty($_SESSION[C('SESSION_ADMIN_NAME')]) && !empty($_SESSION[C('SESSION_ADMIN_ID')]) && strtolower(ACTION_NAME) != 'logout') {
            $this->redirect("Index/index");
        }
        $this->display('login');
    }</code>
Copy after login

Theoretically, loginAction does not inherit baseAction, so it will not redirect. However, the website still prompts me that there are too many redirects, but the pages under the front-end index.php are all normal, which is backend system redirectiondepressing

The directory structure is:
Server deployment thinkphp3.1.3 has too many redirects


I tried modifying the pathinfo mode and looked at nginx’s rewrite mode but it didn’t work either

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!