thinkphp的使用——隐藏index.php
官方默認的。htaccess文件
<IfModule mod_rewrite.c>
? Options +FollowSymlinks -Multiviews
? RewriteEngine On
? RewriteCond %{REQUEST_FILENAME} !-d
? RewriteCond %{REQUEST_FILENAME} !-f
? RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
</IfModule>
如果用的是phpstudy
<IfModule mod_rewrite.c>
? Options +FollowSymlinks -Multiviews
? RewriteEngine On
? RewriteCond %{REQUEST_FILENAME} !-d
? RewriteCond %{REQUEST_FILENAME} !-f
? RewriteRule ^(.*)$ index.php [L,E=PATH_INFO:$1]
</IfModule>
Nginx環境,可以在Nginx.conf
location /{//..... 省略了部分代碼
if!(!-e $request_filename){
rewrite?^(.*)$? /index.php?s=/$1 last;
break;
}
}
?
轉載于:https://www.cnblogs.com/yang1com/p/9372823.html
與50位技術專家面對面20年技術見證,附贈技術全景圖總結
以上是生活随笔為你收集整理的thinkphp的使用——隐藏index.php的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: ldap集成nginx
- 下一篇: Appscan漏洞 之 加密会话(SSL