Home >Backend Development >PHP Tutorial >thinkphp去掉index.php

thinkphp去掉index.php

WBOY
WBOYOriginal
2016-06-23 13:46:491090browse

1.配置apache的配置,,httpd.conf

#LoadModule rewrite_module modules/mod_rewrite.so      //讲前面的#去掉

2.将AllowOverride None改为All


3.在项目配置文件里面配置

'URL_MODEL' => '2'

4.在网站根目录下面创建.htaccess文件,,内容如下

 <ifmodule mod_rewrite.c>                       RewriteEngine on                       RewriteCond %{REQUEST_FILENAME} !-d                       RewriteCond %{REQUEST_FILENAME} !-f                       RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]               </ifmodule>



Statement:
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