Four url access modes in thinkphp

Source: Internet
Author: User
Taoyou who have used the apche server and those who have studied seo may know the degree of pseudo-static friendliness to search engines. many people will want to use the static link access mode. Don't worry about it here, thinkphp

First Normal access mode

Example: www.dongxiaohan.com? Cat = 1 this is what we call dynamic link with a php Link character (note: only the link mode is described)

PATHINFO access mode 2

For example, www.dongxiaohan.com/category/wp adds a parsing string and parses the php Link character into/or something.

Third REWRITE Pseudo-static mode

Taoyou who have used the apche server and have research on seo may know the friendliness of pseudo-static to search engines. many people will want to use the static link access mode, so don't worry about it here, thinkphp provides the pseudo-static link access mode we need. The standard pseudo-static name is: url address rewriting.

Example: www.dongxiaohan.com/153.html

The fourth hybrid mode is what we call the compatibility mode.

PATHINFO is the default access mode of thinkphp.

How is the definition in thinkphp defined? thinkphp defines this function: URL_MODEL we need to define it in the config file.

The URL_MODEL corresponds to four modes: 0, 1, 2, and 3.

0 refers to the normal mode. this is a good note that the normal mode 0 is the most primitive

1 refers to the PATHINFO mode. In fact, it is easy to remember that with the original pattern, we need to make a slight change on the basis of the original pattern.

2. the pseudo-static access mode is also called the url address rewriting mode, in fact, we can remember that we have the first two kinds of good looks, but it is not so good to be practical. we have changed to this type of diversification.

3 refers to the last compatible mode. let's look at it and remember that with the first three, we certainly need to think about perfection (of course, this is an understanding of the meaning)

Of course, we don't have to bother to remember the manual, but I think it is really troublesome .....

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.