Prerequisite one: In the Php+apache configuration environment
First, set the thinkphp project default entry file:
Locate the Apache installation directory apache24\conf\ under configuration file: Httpd.conf file. Find DirectoryIndex after opening
Change the default index.html file to a index.php file (any portal file you want to set)
After restarting Apache, the settings take effect.
Note: When moving an item to another computer or server, because the default portal file is configured in Apache, it will not be moved to another computer as the project, so be aware that other computers and development computers should be consistent, otherwise they will not run the project program properly
Second, set the URL rewrite mode
Locate the Apache installation directory apache24\conf\ under configuration file: Httpd.conf file.
1. Find mod_rewrite.so Remove Current line comment, add load write mode
2. Change the default setting of none after all allowoverride to: all
1)
2)
3)
And in the thinkphp file Config file, configure the rewrite mode to 2:
Rewriter Rewrite mode
' Url_model ' =>2,
After restarting Apache, the settings take effect.
Note: Because URL rewrite mode is configured in Apache, it does not move with the project. So note that other computer configurations should be consistent, otherwise the project program will not run properly
Set thinkphp (3.2.1) Default entry file, and URL rewrite mode