Thinkphp has four types of URL patterns, the default pathinfo mode

Source: Internet
Author: User

There are four thinkphp URL patterns, the default is PathInfo mode, the other three are: normal mode, rewrite and compatibility mode.

The browser input format is:
http://localhost/demo39/index.php/module/Controller/operation

The controller at home establishes the UserController.calss.php as shown in:

Enter HTTP on the browser ://localhost/demo39/index.php/home/user

The results are as follows: user index

In the browser, enter the above mentioned input format, such as http://localhost/demo39/index.php/home/user/test/user/lee/pass/123

is displayed as:

The default delimiter in PATHINFO mode is/, we can set it to what you want, for example: _

At this point, modify the common/conf/config.php under

Add to

Set the PATHINFO ' url_pathinfo_depr ' = ' _ ',

As shown in the following:

  

At this point, enter HTTP on the browser ://localhost/demo39/index.php/home_user_test_user_lee_pass_123

It is important to note that you will start using the _ symbol after home to get the result as shown:

Thinkphp has four types of URL patterns, the default pathinfo mode

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.