Home >Backend Development >PHP Tutorial >ThinkPHP5.X PHP5.6.27-nts and Apache hide the entry file index.php through URL rewriting

ThinkPHP5.X PHP5.6.27-nts and Apache hide the entry file index.php through URL rewriting

不言
不言Original
2018-07-20 10:11:352384browse

这篇文章给大家介绍的内容是关于ThinkPHP5.X PHP5.6.27-nts和Apache通过URL重写来隐藏入口文件index.php ,有着一定的参考价值,有需要的朋友可以参考一下。

我们先来看看官方手册给出关于「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系统)

The above is the detailed content of ThinkPHP5.X PHP5.6.27-nts and Apache hide the entry file index.php through URL rewriting. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn