首页 > 开发 > Apache > 正文

apache No input file specified的解决办法

2020-10-12 18:50:29
字体:
来源:转载
供稿:网友

apache No input file specified,今天是我们配置apache RewriteRule时出现这种问题,解决办法很简单如下

打开.htaccess 在RewriteRule 后面的index.php后面添加一个“?”完整代码如下

  1. .htaccess 
  2. RewriteEngine on 
  3. RewriteCond $1 !^(index.php|images|robots.txt)    
  4. RewriteRule ^(.*)$ /index.php?/$1 [L] 

如果是apache服务器出问题,看看是不是的Apache 把 .php 后缀的文件解析哪里有问题了。

总结:Apache 将哪些后缀作为 PHP 解析。例如,让 Apache 把 .php 后缀的文件解析为 PHP。可以将任何后缀的文件解析为 PHP,只要在以下语句中加入并用空格分开。这里以添加一个 .phtml 来示例。

AddType application/x-httpd-php .php .phtml

为了将 .php 作为 PHP 的源文件进行语法高亮显示,还可以加上:

AddType application/x-httpd-php-source .phps

用通常的过程启动 Apache(必须完全停止 Apache 再重新启动,而不是用 HUP 或者 USR1 信号使 Apache 重新加载)。

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表