APACHE支持.htaccess以及 No input file specified解决方案
在你的Apache安装文件夹conf里找到httpd.conf文件
搜索LoadModule rewrite_module modules/mod_rewrite.so 如果前面有注释符号#,请去掉。
搜索Options FollowSymLinks,然后将它下面的AllowOverride None 修改为AllowOverride All;
【1】
没想到遇见了 No input file specified 因为项目用了URL route ,估摸着可能是rewrite的问题。
记录一下解决方案。
1.检查doc_root 是否设置此值
2.检查.hta文件 , 很多框架都是index.php当入口文件。
默认的
RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
规则在apache fastcgi模式下会导致No input file specified.
修改成
RewriteRule ^(.*)$ index.php [L,E=PATH_INFO:$1]
就OK,地址正常重写。
【2】
我们都知道,使用伪静态相对来说,对搜索引擎比较友好,而我在Dreamhost的空间上启用REWRITE的伪静态功能的时候,首页可以访问,而访问内页的时候,就提示:“No input file specified.”。
百度搜索了一下,发现还有其它空间商也有此问题,原因在于空间所使用的PHP是fast_cgi模式,而在某些情况下, 不能正确识别path_info所造成的错误,就是Wordpress也有一样的问题,还好找到了解决方案!
我们首先来看一下Wordpress及Typecho等程序默认的.htaccess里面的规则:
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L]
而提示是说:“No input file specified.”,也就是说没有得到有效的文件路径。在Google中找到了解决方案,就是修改一下伪静态规则,如下:
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?/$1 [L]
在正则结果“$1”前面多加了一个“?”号,问题也就随之解决了。
APACHE支持.htaccess以及 No input file specified解决方案的更多相关文章
- phpstudy APACHE支持.htaccess以及 No input file specified解决方案
APACHE支持.htaccess以及 No input file specified解决方案 你的Apache安装文件夹conf里找到httpd.conf文件 索LoadModule rewrite ...
- PHP如何让apache支持.htaccess 解决Internal Server Error The server …错误
TP框架 打开 www.newtp.com/index.php/Home/Index/abc出现 如下错误: Internal Server Error The server encountered ...
- 如何让apache支持.htaccess 解决Internal Server Error The server …错误
如何让apache支持.htaccess 解决Internal Server Error The server …错误 文章来源:小灰博客| 时间:2013-12-25 12:17:08| 作者:Le ...
- Apache支持.htaccess配置方法
打开httpd.conf文件用文本编辑器打开后,查找 代码如下 复制代码 Options FollowSymLinks AllowOverride None 改为: Options FollowSy ...
- APACHE服务器出现No input file specified.解决方案
thinkcmf程序默认的.htaccess里面的规则: <IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{REQUEST_F ...
- 让apache支持htaccess文件
第一:检测 apache是否开启mod_rewrite 通过php提供的phpinfo()函数查看环境配置,在"apache2handler -> Loaded Modules&quo ...
- Linux启动Apache支持.htaccess伪静态文件方法
第一.编辑httpd.conf文件 A - 在etc/httpd/conf/目录下的httpd.conf 文件,找到: LoadModule rewrite_module modules/mod_re ...
- Apache 支持.htaccess
******************************************************************************* Apache 服务器 ********* ...
- apache 支持.htaccess重写url
1. httpd.conf 添加: <Directory /> Options +Indexes +FollowSymLinks +Multiviews AllowOverride all ...
随机推荐
- HBase shell 常用指令
HBase shell 常用指令 连接HBase $ ./bin/hbase shell 打开帮助 hbase(main):001:0> help 创建表 hbase(main):003:0&g ...
- org.apache.hadoop.fs-PositionedReadable
package org.apache.hadoop.fs; import java.io.*; import org.apache.hadoop.fs.*; /** Stream that permi ...
- Magical Forest
Problem Description There is a forest can be seen as N * M grid. In this forest, there is some magic ...
- SSH框架整合面试题
1. 谈谈你mvc的理解MVC是Model-View-Controler的简称.即模型-视图-控制器.MVC是一种设计模式,它强制性的把应用程序的输入.处理和输出分开.MVC中的模型.视图.控制器它们 ...
- Redis' High Availability
Redis Sentinel is a system designed to help managing Redis instances. It performs the following thre ...
- u-boot移植为tiny6410步骤
1. 修改顶层Makefile文件 2. 修改arch/arm/cpu/arm1176/s3c64xx/cpu_init.S 3. 修改arch/arm/cpu/arm1176/s3c64xx/Mak ...
- pgpool postgresql集群、中间件
pgpool-II是一个工作于PostgreSQL服务器端和PostgreSQL客户端之间的中间件,它提供了如下的功能: 1.连接池 pgpool-II中保存了到PostgreSQL服务器的连接,然后 ...
- [改善Java代码]推荐覆写toString方法
建议49: 推荐覆写toString方法 为什么要覆写toString方法,这个问题很简单,因为Java提供的默认toString方法不友好,打印出来看不懂,不覆写不行,看这样一段代码: public ...
- HTML+CSS 实现水流流动效果
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta http ...
- Nginx - Windows 环境安装 Nginx
1. 访问 http://nginx.org/en/download.html,下载 Windows 版本的安装包 2. 解压安装包,双击 nginx.exe,启动 nginx 3. 访问 http: ...