The configuration settings of phpstudy hide the entry file of thinkphp


  1. Modify the apache configuration file (httpd.conf)
Find and delete the ( # ) in front of rewrite_module ;

Modify the location code in the image below (change None to All).

2. In the root directory of the project using ThinkPHP, modify or create a new (.htaccess) file
Write the following code:
<IfModule mod_rewrite.c>
RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
</IfModule>
3. Bind Home in the entry file index.php (under the project root directory)
define('BIND_MODULE','Home');


Completion: The address can be accessed from www.think.com/index.php/Home/think/
Abbreviated as: www.think.com/think/

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325651048&siteId=291194637