thinkphp配置rewrite模式访问时不生效 出现No input file specified解决方法

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

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

  

出现No input file specified 页面提示,

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

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

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

</td>
<td class="code">
<div class="container">
<div class="line number1 index0 alt2"><code class="csharp plain">^(.*)$ index.php/$1 [QSA,L]

</td>

</tr></table>

  

应该改成

</td>
<td class="code">
<div class="container">
<div class="line number1 index0 alt2"><code class="csharp plain">^(.*)$ index.php?s=$1 [QSA,L]

</td>

</tr></table>

</td>
<td class="code">
<div class="container">
<div class="line number1 index0 alt2">
<code class="csharp plain"><span style=
<code class="csharp string">"font-size: 14px;"
<code class="csharp plain">>所以.htaccess文件的代码为

</td>

</tr></table>

复制代码

1 
2     RewriteEngine on
3     RewriteCond %{REQUEST_FILENAME} !-d
4     RewriteCond %{REQUEST_FILENAME} !-f
5     RewriteRule ^(.*)$ index.php?s=$1 [QSA,L]
6 
复制代码

ThinkPHPThinkPHP教程

相关文章

(1)创建数据表: CREATE TABLE IF NOT EXISTS `think_form` ...
组合查询的主体还是采用数组方式查询,只是加入了一些特殊的...
(1)创建模版:/App/Home/View/Form/edit.html   <FORM m...
自定义配置文件user.php: <?php return array(    \'se...
在一些成熟的CMS系统中,后台一般都包含一个配置中心(如织梦...
废话不多说先上图预览下,即本博客的分页; 这个分页类是在...