thinkphp routing parsing (meaning of four URLs, differences, and setting the true effect of a URL)

Source: Internet
Author: User

Principle:

Locate the specified controller through the URL address get parameter and make the corresponding method call request

HTTP//URL/index.php?m= module name &c= Controller &a= method


The thinkphp framework URL can have the following four types

1.http://URL/index.php?m= Module name &c= Controller &a= method Basic get mode

2.http://URL/index.php/Module/controller/method Path mode PathInfo

3.http://URL/module/controller/method rewrite override mode

4.http://URL/index.php?s=/Module/controller/method Compatibility mode


Specific URL address mode settings (config file thinkphp/conf/convertion.php)

Url_model = 0/1/2/3 represents four URL address modes respectively

To modify the schema, you can go to your own project directory configuration file modification (shop/common/conf/config.php)

<?phpreturn Array (' url_model ' = 0;);

Role:

Our system is compatible with 4 types of URL address patterns, although set one, but the other three still can access the normal

Set ' Url_model ' + 0; The real function is that the system sometimes automatically creates a URL address, which is used to create a URL address based on the current schema. After Setup, you need to empty the cache before it takes effect, or use development debug mode

U ("module, Controller, Method"); Create the corresponding URL address according to the parameter and URL pattern


thinkphp routing parsing (meaning of four URLs, differences, and setting the true effect of a URL)

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.