zoukankan      html  css  js  c++  java
  • thinkphp配置rewrite模式访问时不生效 出现No input file specified解决方法

    使用thinkphp配置rewire模式的路径访问网站时,

    直接复制官网的.htaccess文件的代码复制过去

    1
    2
    3
    4
    5
    6
    <IfModule mod_rewrite.c>
        RewriteEngine on
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
    </IfModule>

      

    出现No input file specified 页面提示,

    在apache配置文件httpd-conf捣腾了好一阵子,

    都没有解决到,

    1. 如果开启了虚拟目录,则虚拟目录中 AllowOverride也要改为 all

    2.

    如果php运行模式是FastCGI模式,

    在此模式下以下重写规则不适用的

    1
    ^(.*)$ index.php/$1 [QSA,PT,L]

      

    应该改成

     
    1
    ^(.*)$ index.php?s=$1 [QSA,PT,L]
    . htaccess中的内容修改为
    <IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ index.php?s=$1 [QSA,PT,L](与官网的不同)
    </IfModule>
     
     
     
  • 相关阅读:
    c++ 启发式搜索解决八数码问题
    基于linux或windows的c/s的循环服务器求一元二次方程的根
    基于linux或windows平台上的c/s简单通信
    第七章总结
    第六章总结
    第五章总结
    第四章总结
    第一章总结
    第三章总结
    第二章总结
  • 原文地址:https://www.cnblogs.com/w10234/p/6669756.html
Copyright © 2011-2022 走看看