PHP automatically jumps to the home module

Source: Internet
Author: User
With the thinkphp frame.


Input in Browser
http://127.0.0.1/NovoMagic/index.php/Dac/Test/d

Automatically jump to the login page
Http://127.0.0.1/NovoMagic/index.php/Home/Login/index.html

I didn't write anything in the/dac/test/d. Why would you jump to the login page?

Using Firebug to view the network situation is as follows:


Why it automatically jumps to the login page.

PS: If I log in, then access to http://127.0.0.1/NovoMagic/index.php/Dac/Test/d is no problem.

So it seems like I realized the function of the interceptor, all the URLs automatically intercept ah .... But I don't have anything to configure.


Reply to discussion (solution)

TP is unfamiliar. Guess is that you inherited the controller or a call to the file has a login detection.
specifically to read the code before you know.

Your introduction of the file common.php, is not written in what Dongdong, such as init initialization function.

Magic question, do you see the controller inside and you introduced the common.php inside is there is a judge whether the login code?

Thinkphp has a _initialize () method that runs this method automatically when any function of this module is run
Do you want to see if the file has this method?

Initialization method has to determine whether the login code, landlord check.

You should route the problem, see if you use Nginx? Your nginx uses TP need to configure routing, and use the routing mode to change to
' Url_model ' + 0,//URL access mode, optional parameters 0, 1, 2, 3, representing the following four modes
Give it a try

Look at the log log in runtime at a glance.

Thank you for your attention. Finally found that he used the TP similar to the filter of the object Control permission.

Alas, rewriting someone else's code is really hard.

  • 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.