thinkphp removes index.php (?s=) in the URL, thinkphpindex.php_PHP tutorial

WBOY
Release: 2016-07-13 10:22:15
Original
1463 people have browsed it

thinkphp remove index.php (?s=) in the URL, thinkphpindex.php

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: RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*) $ index.php/$1 [QSA,PT,L]

thinkphp url rewriting, how to remove indexphp

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]


When using thinkphp, how to remove only the indexphp URL path?

.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

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/849148.htmlTechArticlethinkphp remove index.php (?s=) in the URL, thinkphpindex.php. For example, your original path is http ://localhost/test/index.php/home/goods/index.html Then the current address is http://lo...
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!