此问题出现在.htaccess上
Apache按如下代码修改即可:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?/$1 [L]
Nginx按如下代码修改即可:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [L]
Apache与Nninx与的区别在于,Apache的index.php后多了一个?
 
2018年10月15日 16:52:48再次编辑本文:
使用如下方式在nginx和apache下都可以使用:
RewriteEngine on
# 如果是一个目录或者文件,就访问目录或文件
RewriteCond %{REQUEST_FILENAME} !-d
# 如果文件存在,就直接访问文件,不进行下面的RewriteRule
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule . index.php

  

  

php框架路由美化后提示No input file specified的更多相关文章

  1. 解决 php 报错 open_basedir restriction in effect或者nginx提示No input file specified怎么办

    解决 php 报错 open_basedir restriction in effect或者nginx提示No input file specified怎么办 问题是出现在了PHP.INI上面了 ,原 ...

  2. Dreamhost 提示No input file specified. 的解决的方法

    假设开启FastCGI模式,.htaccess无法生效,一直提示no input file specified. 由于在Fastcgi模式下.php不支持rewrite的目标网址的PATH_INFO的 ...

  3. TP5使用路由模式报错 No input file specified.

    热烈推荐:超多IT资源,尽在798资源网 application/route.php 是设置路由的文件. 将 route.php 代码修改为 <?php use think\Route; Ro ...

  4. 64位Ubuntu14.04配置adb后提示No such file or directory

    配置好SDK的环境变量后,输入adb提示 No such file or directory. 原因:由于是64位的linux系统,而Android SDK只有32位的,需要安装一些支持包才能使用 1 ...

  5. 提示No input file specified的解决方法

    (一)IIS Noinput file specified 方法一:改PHP.ini中的doc_root行,打开ini文件注释掉此行,然后重启IIS 方法二: 请修改php.ini 找到 ; cgi. ...

  6. onethink 重写URL后,apache提示No input file specified

    <IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{RE ...

  7. thinkPHP 出现route不起作用提示No input file specified.

    修改.htaccess文件 原因在于使用的PHP是fast_cgi模式,而在某些情况下,不能正确识别path_info所造成的错误. 打开.htaccess 在RewriteRule 后面的index ...

  8. nginx提示No input file specified怎么办

    用了网上提供的各种方法都不行,即便html能正常打开,php文件依然有问题.而后继续尝试了修改权限 chown -vR www:www /folder 功能都正常. nginx.conf 的 user ...

  9. nginx no input file specified

    今天在lnmp上调试php项目,之前已经在上面测试过tp5框架,可以正常访问.但是新项目由于项目中有些路径是写固定路径的.为了不去修改代码.配置新项目的时候,为新项目设置新的目录.问题就出现了,网页提 ...

随机推荐

  1. IfcColumn

    IfcColumn is a vertical structural member which often is aligned with a structural grid intersection ...

  2. linux安装redis时报collect2: fatal error: cannot find 'ld'和In file included from adlist.c:34:0:

    如题,看了下该ld命令所在文件: [root@centos redis-]# whereis ld ld: /usr/bin/ld.gold /usr/bin/ld /usr/bin/ld.bfd / ...

  3. SVN中“txn-current-lock:拒绝访问”错误

    SVN服务器使用的是Visual SVN,重装系统后,使用SVN commit是遇到:不能打开文件“XX:\XXXXX\db\txn-current-lock”: 拒绝访问这样的错误. 原因分析: u ...

  4. kerberos相关

    1.kerberos认证覆盖问题 先显示指定KRB5CCNAME存储的路径 export KRB5CCNAME=/tmp/krb5cc_xxx kinit -kt /home/xxx.keytab x ...

  5. python中的绝对导入与相对导入,from __future__ import absolute_import的区别

    相对导入:在不指明 package 名的情况下导入自己这个 package 的模块,比如一个 package 下有 a.py 和 b.py 两个文件,在 a.py 里 from . import b ...

  6. java 迭代的陷阱

    /** * 关于迭代器,有一种常见的误用,就是在迭代的中间调用容器的删除方法. * 但运行时会抛出异常:java.util.ConcurrentModificationException * * 发生 ...

  7. Houdini Python开发实战 课程笔记

    P2 + P3 + P4 + P5 - 基础: 1. Houdini中使用Python的地方 2. Textport:可使用cd.ls等路径操作的命令(命令前加%,可在python中使用) 3. So ...

  8. 共享和独享IP的VPS的区别?

    共享IP的VPS主机: 顾名思义,共享IP的VPS主机的最大特性即是若干VPS主机用户共享同一个公网IP地址,此目的显然是节省有限的IP地址资源,有效应对Ipv4枯竭的问题.其基本原理是,所有VPS主 ...

  9. Session丢失的原因及解决办法

    Asp.net 默认配置下,Session莫名丢失的原因及解决办法: 正常操作情况下Session会无故丢失.因为程序是在不停的被操作,排除Session超时的可能.另外,Session超时时间被设定 ...

  10. 记录一次TraceId的问题

    多服务部署的时候,各个服务通过httpClient进行调用时候,有时候出现问题,需要进行追查.但是如果没有一个标记,就会很迷茫,特别是多个服务来回调用,就无法快速定位问题.这个时候一般是使用MDC的 ...