Apache server is not enabled by default rewrite module, so we visit the thinkphp site when the URL path is generally like this:
Http://127.0.0.1/index.php/index/article/list.html
Here index.php is our site entry file, and in order to achieve better SEO optimization, we need to index.php the entry file, the final implementation of the following access path:
Http://127.0.0.1/index/article/list.html
First step: First, you need to open the Apache server configuration file httpd.conf, load the mod_rewrite.so module.
Specifically, to the author of the Wamp integrated development environment for example, under the directory "C:\wamp\bin\apache\apache2.4.9\conf" to find the Apache configuration file httpd.conf, find mod_rewrite.
#LoadModule Rewrite_module modules/mod_rewrite.so
Then remove the # from the front of the line.
Continue to find all allowoverride None and modify all of them to allowoverride all.
The final reboot of the Apache server will allow the configuration to take effect.
Second Step: Save the following as a. htaccess file, and put it in the directory of the portal file sibling.
<ifmodule mod_rewrite.c>options +followsymlinks-multiviewsrewriteengine onRewriteCond%{REQUEST_FILENAME}!- Drewritecond%{request_filename}!-frewriterule ^ (. *) $ index.php?/$1 [qsa,pt,l]</ifmodule>
The. htaccess file can be generated with a notepad that comes with Windows. The method is "Save as File type: All Files", and then fill in the file name. htaccess, as shown here:
You can successfully hide the portal file by completing the two-step setup.
thinkphp How to configure hidden portal files