ThinkPHP has four URL access modes, which are described below. ThinkPHP has four URL access modes, which are described below.
I. normal access mode
Http://thinkphp.com/admin.php? M = user & a = checklogin & username = 123 & password = 456
M: module name (controller C), a: method (Operation, action), username (password): passed parameter
II. PATHINFO access mode
Http://thinkphp.com/admin.php/user/checklogin/username/123/password/456
Similar to the normal mode, the & is converted. the above write method is the get transmission mode, and $ _ GET ['username'] can receive the value, we can also use post transmission.
III. REWRITE mode
Http://thinkphp.com/admin/user/checklogin/username/123/password/456
This method is also called address rewriting or pseudo-static mode. You need to uncomment the "LoadModule rewrite_module modules/mod_rewrite.so" statement in the apache configuration file httpd. conf.
IV. hybrid mode
This mode is also called the compatibility mode. it is a combination of the common mode and PATHINFO mode to meet the needs of different operating systems.
The above four URL access modes can be modified in the configuration file of the project file, that is, the configuration file/config. php. the configuration parameter is "URL_MODEL ". The default access mode of ThinkPHP is the second PATHINFO mode. to change it to REWRITE mode, 'URL _ model' => 2;
Let's talk about the constants in ThinkPHP.
Many constants have been defined in ThinkPHP, such as __root _ (website ROOT directory) and _ APP _ (current project portal address), _ URL _ (current module address), _ ACTION _ (Current operation address), and _ SELEF _ (current URL address without domain name), _ CURRENT _ (Template directory of the CURRENT module)
You can refer to the ThinkPHP manual to familiarize yourself with more constants, or customize constants in the config. php file.