Too many redirection operations are required for deploying thinkphp3.1.3 on the server.

Source: Internet
Author: User
The latest project is to be migrated from Windows to linux. it is okay to run locally, but it enters the background system (admin. php) the error is that the process of loading excessive website redirection is admin. php acts as the entry file, and the index controller inherits baseAction, baseAction... the latest project is to be migrated from Windows to linux. it is okay to run locally, but it enters the background system (admin. php), the system reports that the website has too many redirection requests.

The loading process is admin. php as the entry file. The index controller inherits baseAction, which has the following 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');        }    }

Login controller code

Class LoginAction extends Action {/*** display logon page */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 ');}

Theoretically, loginAction does not inherit baseAction, so it does not redirect. However, the website still prompts that I have too many redirects, but the pages under index. php at the front end are normal, that is, the background system redirection is depressing.

The directory structure is:

I tried to modify the pathinfo mode. I can't see nginx rewrite mode.

Solution:

In the most stupid way, start from the entrance file admin. php and trace and print them one by one to see what went wrong, similar to the debugging method of Xiaohuang duck.

exit("123");

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.