No input file specified. Apache解决方案

需求背景

新部署的项目,提示出现“No input file specified.” 如下图所示:
在这里插入图片描述

原伪静态规则

<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>

调整后的伪静态规则

调整代码

<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>

调整后显示内容

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/m0_38068876/article/details/108465527
今日推荐