近期很多人问我,后台点击菜单后会显示No input file specified.错误,这里翻译了一下,意思是未指定输入文件,这个问题的原因是WordPress伪静态未设置下面发一下WordPress伪静态规则的两种环境代码。

WordPress伪静态apache:

1
2
3
4
5
6
7
8
9
10
11
<pre class="prettyprint"><span class="typ">RewriteEngine</span><span class="pln"> </span><span class="typ">On</span>

<span class="typ">RewriteBase</span><span class="pln"> </span><span class="pun">/</span>

<span class="typ">RewriteRule</span><span class="pln"> </span><span class="pun">^</span><span class="pln">index\.php$ </span><span class="pun">-</span><span class="pln"> </span><span class="pun">[</span><span class="pln">L</span><span class="pun">]</span>

<span class="typ">RewriteCond</span><span class="pln"> </span><span class="pun">%</span><span class="comment"><span class="pun">{</span><span class="pln">REQUEST_FILENAME</span><span class="pun">}</span></span><span class="pln"> </span><span class="pun">!-</span><span class="pln">f

</span><span class="typ">RewriteCond</span><span class="pln"> </span><span class="pun">%</span><span class="comment"><span class="pun">{</span><span class="pln">REQUEST_FILENAME</span><span class="pun">}</span></span><span class="pln"> </span><span class="pun">!-</span><span class="pln">d

</span><span class="typ">RewriteRule</span><span class="pln"> </span><span class="pun">.</span><span class="pln"> </span><span class="pun">/</span><span class="pln">index</span><span class="number"><span class="pun">.</span></span><span class="pln">php </span><span class="pun">[</span><span class="pln">L</span><span class="pun">]</span></pre>

WordPress伪静态Nginx:

1
2
3
4
5
6
7
8
9
10
11
<pre class="prettyprint"><span class="pln">rewrite </span><span class="pun">^.*/</span><span class="pln">files</span><span class="pun">/(.*)</span><span class="pln">$ </span><span class="pun">/</span><span class="pln">wp</span><span class="pun">-</span><span class="pln">includes</span><span class="pun">/</span><span class="pln">ms</span><span class="pun">-</span><span class="pln">files</span><span class="number"><span class="pun">.</span></span><span class="pln">php</span><span class="pun">?</span><span class="keyword"><span class="pln">file</span></span><span class="pun">=</span><span class="number"><span class="pln">$1</span></span><span class="pln"> </span><span class="kwd">last</span><span class="pun">;</span>

<span class="keyword"><span class="kwd">if</span></span><span class="pln"> </span><span class="pun">(!-</span><span class="pln">e $request_filename</span><span class="pun">)</span><span class="comment"><span class="pun">{</span></span>

<span class="comment"><span class="pln">    rewrite </span><span class="pun">^.+?(/</span><span class="pln">wp</span><span class="pun">-.*)</span><span class="pln"> $1 </span><span class="kwd">last</span><span class="pun">;</span></span>

<span class="comment"><span class="pln">    rewrite </span><span class="pun">^.+?(/.*</span><span class="pln">\.php</span><span class="pun">)</span><span class="pln">$ $1 </span><span class="kwd">last</span><span class="pun">;</span></span>

<span class="comment"><span class="pln">    rewrite </span><span class="pun">^</span><span class="pln"> </span><span class="pun">/</span><span class="pln">index</span><span class="pun">.</span><span class="pln">php </span><span class="kwd">last</span><span class="pun">;</span></span>

<span class="comment"><span class="pun">}</span></span></pre>

本文转载自:http://aidezy.com/4809.html

1. 本站所有资源来源于用户上传和网络,如有侵权请邮件联系站长!
2. 分享目的仅供大家学习和交流,请不要用于商业用途!
3. 如果你也有好源码或者教程,可以到审核区发布,分享有金币奖励和额外收入!
4. 本站提供的源码、模板、插件等等其他资源,都不包含技术服务请大家谅解!
5. 如有链接无法下载、失效或广告,请联系管理员处理!
6. 本站资源售价只是赞助,收取费用仅维持本站的日常运营所需!
7. 如遇到加密压缩包,默认解压密码为"bk.shulife.cn",如遇到无法解压的请联系管理员!
本站图片外链来源于 tk.shulife.cn 感谢支持!
书生资源博客 » WP显示No input file specified [教程资料]

发表评论

  • 166本站运营(天)
  • 106会员数(个)
  • 534资源数(个)
  • 24评论数(个)
  • 18近 30 天更新(个)
加入 VIP