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捣腾了好一阵子,

    都没有解决到,忽然想到本地测试用的php运行模式是FastCGI模式,

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

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

      

    应该改成

    1
    ^(.*)$ index.php?s=$1 [QSA,PT,L]
    1
    <span style="font-size: 14px;">所以.htaccess文件的代码为<br></span>
    复制代码
    1 <IfModule mod_rewrite.c>
    2     RewriteEngine on
    3     RewriteCond %{REQUEST_FILENAME} !-d
    4     RewriteCond %{REQUEST_FILENAME} !-f
    5     RewriteRule ^(.*)$ index.php?s=$1 [QSA,PT,L]
    6 </IfModule>
    复制代码
  • 相关阅读:
    连载日记
    自我介绍
    test0710 二分专题
    test0709 搜索专题
    test0705
    test0704
    [题解] [HNOI2015]落忆枫音
    test0606
    test0523
    备份
  • 原文地址:https://www.cnblogs.com/tdalcn/p/7063813.html
Copyright © 2011-2022 走看看