输入banner图图片脚本导航/分类

wamp怎么去掉index.php

wamp去掉index.php的方法:1、在httpd.conf配置文件中加载mod_rewrite.so模块;2、将None改为All;3、将URL_MODEL设置为2;4、将htaccess文件放到根目录下。

本文操作环境:windows7系统、PHP7.1版,DELL G3电脑

wamp怎么去掉index.php?WAMP中 省略index.php

1.httpd.conf配置文件中加载了mod_rewrite.so模块 //在APACHE里面去配置

#LoadModule rewrite_module modules/mod_rewrite.so把前面的警号去掉

2.AllowOverride None 讲None改为 All //在APACHE里面去配置 (注意其他地方的AllowOverride也统统设置为ALL)

<Directory "D:/server/apache/cgi-bin">
AllowOverride none  改   AllowOverride ALL
Options None
Order allow,deny
Allow from all
</Directory>

3.确保URL_MODEL设置为2,在项目的配置文件里写

return Array(
   '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>

推荐学习:《PHP视频教程》

以上就是wamp怎么去掉index.php的详细内容,更多请关注gxlcms其它相关文章!