Php automatically jumps to the Home module

Source: Internet
Author: User
I did not write anything in DacTestd. Why did I jump to php and automatically jump to the Home module?
The thinkPhP framework is used.


Input in the browser
Http: // 127.0.0.1/NovoMagic/index. php/Dac/Test/d

The logon page is automatically displayed.
Http: // 127.0.0.1/NovoMagic/index. php/Home/Login/index.html

I did not write anything in/Dac/Test/d. Why does it jump to the logon page.

Use firebug to view network conditions as follows:


Why does it automatically jump to the logon page.

PS: If I log on to the console and access http: // 127.0.0.1/NovoMagic/index. php/Dac/Test/d again, no problem will occur.

In this case, it seems that I have implemented the interceptor function. all URLs are automatically intercepted .... But I have no configuration items.
------ Solution ----------------------
TP is unfamiliar. It is assumed that the controller you inherited or a called file contains a logon check.
Read the code.
------ Solution ----------------------
Is there anything written in your introduced file common. php, such as the init initialization function.
------ Solution ----------------------
The Magic problem is, do you see the code in controller and the common. php introduced by you to determine whether to log on?
------ Solution ----------------------
Thinkphp has a _ initialize () method. this method is automatically run when any function of this module is run.
Check whether the file has this method.
------ Solution ----------------------
The initialization method contains the code to determine whether login is used. check it.
------ Solution ----------------------
The routing problem should be solved. can you see if you are using nginx? You need to configure routes for nginx to use TP, and change the routing mode
'URL _ model' => 0, // URL access mode. optional values: 0, 1, 2, and 3, indicating the following four modes:
Try
------ Solution ----------------------
Check the log in Runtime at a glance

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.