ThinkPHP5.X PHP5.6.27-nts + Apache 经过 URL 重写来隐藏入口文件 index.php

咱们先来看看官方手册给出关于「URL 重写」的参考:php

能够经过 URL 重写隐藏应用的入口文件 index.php ,Apache 的配置参考:

一、http.conf 配置文件加载 mod_rewrite.so 模块
二、AllowOverride Node 中将 None 改成 All
三、将下面的内容保存为 .htaccess 放置入口文件同级目录下iview

<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 文件完成了救赎~ide

以上能解决出现 No input file specified 错误。code

相关文章
相关标签/搜索