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

不言
Release: 2023-04-03 09:54:01
Original
2401 people have browsed it

这篇文章给大家介绍的内容是关于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>
Copy after login

最后,我通过修改 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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template