thinkphp去除index . php的方法

  介绍

这篇文章主要介绍thinkphp去除index . php的方法,文中介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们一定要看完!

thinkphp去除index . php的方法:首先加载mod_rewrite。所以模块,然后将AllowOverride中没有的没有改为;最后将htaccess文件放到根目录下即可。

<强> Thinkphp <强>中去除URL里的索引。php

例如你的原路径是http://localhost/test/index。php/索引/添加

那么现在的地址是http://localhost/test/index/add

如何去掉index . php呢?

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

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

2。AllowOverride没有讲没有改为所有//在APACHE里面去配置

& lt;目录“D:/服务器/APACHE/cgi-bin"比;   AllowOverride没有改AllowOverride   选项没有   为了允许,拒绝   允许从所有   & lt;/Directory>

3。确保URL_MODEL设置为2,

在项目的配置文件里写

返回数组(   & # 39;URL_MODEL& # 39;=比;& # 39;2 & # 39;   );

4 . htaccess文件必须放到跟目录下

这个文件里面加:

& lt; IfModule mod_rewrite.c>   RewriteEngine> + FollowSymlinks选项   & lt; IfModule mod_rewrite.c>   RewriteEngine>以上是“thinkphp去除index . php的方法”这篇文章的所有内容,感谢各位的阅读!希望分享的内容对大家有帮助,更多相关知识,欢迎关注行业资讯频道!

thinkphp去除index . php的方法