1. First modify the Apache httpd.conf file.
Verify that the Mod_rewrite.so module is loaded in the httpd.conf configuration file, and the method is loaded by removing the comment # number in front of the mod_rewrite.so
Speak httpd.conf in allowoverride none to change none to all
2. Open the corresponding project configuration file, my Project profile is myapp/conf/config.php, add a line in this profile array, ' Url_model ' =>2
3. Create a. htaccess file below the root of the project, and write the following content:
<ifmodule rewrite_module>
Rewriteengine on
Rewritecond%{request_filename}!-d
Rewritecond%{request_filename}!-f
Rewriterule ^ (. *) $ index.php/$1 [qsa,pt,l]
</IfModule>
4. Restart Apache.
5. Enter in the browser: Http://localhost/Home/User can be accessed.
Thinkphp using the Rewrite rules of the. htaccess file to hide index.php in the URL