tp隐藏“index.php”的方法:首先找到并打开“/public/.htaccess”文件;然后根据php环境分别设置“.htaccess”文件;最后保存修改即可。
tp5隐藏index.php
一,找到/public/.htaccess文件,如果你的入口文件已经移动到根目录下,那么你的.htaccess文件也要剪切到根目录下,总之要确保.htaccess跟入口的index.php保持同级。
二,根据你的php环境分别设置.htaccess文件:
apache:
<ifmodule mod_rewrite.c>options followsymlinks -multiviewsrewriteengine onrewritecond %{request_filename} !-drewritecond %{request_filename} !-frewriterule ^(.*)$ 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; }}推荐学习:《thinkphp框架》
网站运营大咖告诉你如何写一篇有价值的新闻百度智慧云服务器网页下载速度慢免费个人服务器我的域名备案怎么还没审核完成都这么久了我等着做做网站呢云服务器怎么迁移数据购买云平台服务器要服务费建网站虚拟主机和云服务器帮我看下为什么都是病毒-虚拟主机/数据库问题