zoukankan      html  css  js  c++  java
  • APACHE服务器出现No input file specified.的完美解决方案

    转自:http://www.upupw.net/server/n53.html


    启用REWRITE的伪静态功能的时候,首页可以访问,而访问内页的时候,就提示:“No input file specified.”


    原因在于使用的PHP是fast_cgi模式,而在某些情况下,不能正确识别path_info所造成的错误,Wordpress的伪静态也有一样的问题。


    Wordpress程序默认的.htaccess里面的规则:


    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ /index.php/$1 [L]
    “No input file specified.”,是没有得到有效的文件路径造成的。


    修改伪静态规则,如下:


    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ /index.php?/$1 [L]
    有没有发现不同?


    其实就是在正则结果“/$1”前面多加了一个“?”号,问题也就随之解决了。



    其他框架也是如此更改
  • 相关阅读:
    Git从入门到放弃
    Flex布局
    网络模型与TCP协议
    命令行技巧
    React环境搭建及部署
    Vue环境搭建及部署
    Python 集合set()
    Python-100天代码
    删除Windows启动管理器下的加载项
    windos7操作系统下easyBCD2.3安装Ubuntu18.04.1-desktop-amd64.iso双系统
  • 原文地址:https://www.cnblogs.com/lxwphp/p/15454976.html
Copyright © 2011-2022 走看看