在你的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解决方案的更多相关文章

  1. phpstudy APACHE支持.htaccess以及 No input file specified解决方案

    APACHE支持.htaccess以及 No input file specified解决方案 你的Apache安装文件夹conf里找到httpd.conf文件 索LoadModule rewrite ...

  2. PHP如何让apache支持.htaccess 解决Internal Server Error The server …错误

    TP框架  打开 www.newtp.com/index.php/Home/Index/abc出现 如下错误: Internal Server Error The server encountered ...

  3. 如何让apache支持.htaccess 解决Internal Server Error The server …错误

    如何让apache支持.htaccess 解决Internal Server Error The server …错误 文章来源:小灰博客| 时间:2013-12-25 12:17:08| 作者:Le ...

  4. Apache支持.htaccess配置方法

    打开httpd.conf文件用文本编辑器打开后,查找  代码如下 复制代码 Options FollowSymLinks AllowOverride None 改为: Options FollowSy ...

  5. APACHE服务器出现No input file specified.解决方案

    thinkcmf程序默认的.htaccess里面的规则: <IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{REQUEST_F ...

  6. 让apache支持htaccess文件

    第一:检测 apache是否开启mod_rewrite 通过php提供的phpinfo()函数查看环境配置,在"apache2handler -> Loaded Modules&quo ...

  7. Linux启动Apache支持.htaccess伪静态文件方法

    第一.编辑httpd.conf文件 A - 在etc/httpd/conf/目录下的httpd.conf 文件,找到: LoadModule rewrite_module modules/mod_re ...

  8. Apache 支持.htaccess

    ******************************************************************************* Apache 服务器 ********* ...

  9. apache 支持.htaccess重写url

    1. httpd.conf 添加: <Directory /> Options +Indexes +FollowSymLinks +Multiviews AllowOverride all ...

随机推荐

  1. linux 安装xamp

    前一久用上了ubuntu,想折腾下小窝,懒得自己去装Php啊,apache 之类的东西,刚才用上xampp,直接点,等以后要涉及深再弄,暂时先用着xampp.还不错,很好用,这里简单说下安装,(我是新 ...

  2. 无法挂载 “7.9 GB Filesystem”.

    有个8G的U盘,格式化成exfat格式.插入电脑后点击盘符,弹出错误提示: 无法挂载 “7.9 GB Filesystem”. Error mounting: mount exited with ex ...

  3. linux 文件夹权限及umask

    先创建一个目录,看看权限: $ ll 总用量 drwxrwxr-x huangxm huangxm 2月 : ./ drwxr-xr-x huangxm huangxm 2月 : ../ drwxrw ...

  4. python(1) - 第一个程序 Hello World!

    进入python3的解释器环境. 我们让解释器输出 “Hello World!” 解释器成功的输出了Hello world!  程序就这样完成了. 当然上面的程序我们是在解释器中完成的. 我们可以通过 ...

  5. 配置tomcat连接器后,启动服务报错“No Certificate file specified or invalid file format"异常

    1:原来的配置是 <Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true&quo ...

  6. hdu 2412 树形DP

    思路:对于最大的人数很容易想到,就直接dp.但对于最大值是否唯一就需要应用辅助数组,isOnly[i][0]表示dp[i][0]是否唯一,同理isOnly[i][1]. 那么当(dp[v][0]> ...

  7. hihocoder 1237 Farthest Point

    #1237 : Farthest Point 时间限制:5000ms 单点时限:1000ms 内存限制:256MB 描述 Given a circle on a two-dimentional pla ...

  8. C#操作Excel数据增删改查示例

    Excel数据增删改查我们可以使用c#进行操作,首先创建ExcelDB.xlsx文件,并添加两张工作表,接下按照下面的操作步骤即可 C#操作Excel数据增删改查. 首先创建ExcelDB.xlsx文 ...

  9. asp.net自定义控件

    回发星级控件 using System; using System.ComponentModel; using System.Web.UI; using System.Web.UI.WebContro ...

  10. React Native之ViewPagerAndroid跳转页面问题

    前言: 网上目前react-native的教程较少,加上许多帖子还是用的ES5(2015年6月已发布ES6标准),有些细节很难找到答案,这里把遇到的问题做一个分享,让学习者尽量少踩坑. 出现问题: 1 ...