Home >Backend Development >PHP Tutorial >thinkphp removes index.php (?s=) in the URL, thinkphpindex.php_PHP tutorial
For example, your original path is http://localhost/test/index.php/ home/goods/index.html Then the current address is http://localhost/test/home/goods/index.html How to remove index.php?
1.mod_rewrite.so is loaded in the httpd.conf configuration file Module //Configure #LoadModule in APACHE rewrite_module modules/mod_rewrite.so and remove the previous alarm
2.AllowOverride None Change None to All //Configure in APACHE (note that AllowOverride in other places is also set to ALL)
3. Make sure the configuration item URL_MODEL in config.php is set to 2 return Array( 'URL_MODEL' => '2', );
4 The .htaccess file must be placed in the project and directory and add:
Create a .htaccess file under the project. .htaccess is the file name with a small dot in front and the content is
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
.htaccess file code
deny from all
Redirect permanent /index .php /
order deny,allow
or refer to ThinkPHP3.0 Complete Development Manual 16.2 Hide index.php