thinkphp has four URL modes:
0 Normal Mode http://localhost/imooc/index.php?m=Index&a=user&id=1
Normal mode is the traditional get parameter to specify the current access to the module and operation, there is a conflict between M and other page backend values are either, back-end value method, or rewrite the naming of different patterns
// The default module gets the variable // default controller Get variable // default action gets variable
1 default mode pathinfo mode http://localhost/imooc/index.php/Index/user/id/1.html
Provides the best SEO support, the system has already done the environment compatibility processing, so can support most host environment:
Modifying the split configuration of/controller/action/params.html‘URL_PATHINFO_DEPR‘=>‘-‘,
2 rewrite mode http://localhost/imooc/Index/user/id/1.html
Rewrite mode is a son Ah pathinfo on the basis of a further improvement: You can remove the URL address inside the portal file index.php, but need to configure additional Web server rewrite rules.
Apache will need to add the. htaccess file to the sibling of the portal file:
<ifmodule mod_rewrite.c>%{request_filename}-%{request_filename}-^ (. *) $ index.php/$1 [Qsa,pt,L]</IfModule>
3 Compatibility Mode http://localhost/imooc/index.php?s=/Index/user/id/1.html
Compatibility mode, in conjunction with the definition of a Web server rewrite rule, can achieve the same URL effect as rewrite mode.
Apache's. htaccess Configuration notation
<ifmodule mod_rewrite.c>%{request_filename}-%{request_filename}-^ (. *) $ index.php?s=/$1 [Qsa,pt,L]</IfModule>
thinkphp learning _4 in URL mode