我们先来看看官方手册给出关于「URL 重写」的参考:
可以通过 URL 重写隐藏应用的入口文件 index.php ,Apache 的配置参考:
1、http.conf 配置文件加载 mod_rewrite.so 模块
2、AllowOverride Node 中将 None 改为 All
3、将下面的内容保存为 .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>
最后,我通过修改 ThinkPHP 入口文件同级目录下的 .htaccess 文件完成了救赎~
以上能解决出现 No input file specified 错误。
相关推荐:
Laravel开发环境部署之homestead 安装配置过程(windows系统)
以上就是ThinkPHP5.X PHP5.6.27-nts和Apache通过URL重写来隐藏入口文件index.php的详细内容,更多请关注php中文网其它相关文章!
![php中文网最新课程二维码](/static/images/article_wechat2021.jpg?1111)
声明:本文原创发布php中文网,转载请注明出处,感谢您的尊重!如有疑问,请联系admin@php.cn处理
网友评论
文明上网理性发言,请遵守 新闻评论服务协议
我要评论