【问题标题】:Wordpress pretty permalinks "No Input File Specified" errorWordpress 漂亮的永久链接“未指定输入文件”错误
【发布时间】:2012-09-27 04:50:08
【问题描述】:

我在使用漂亮的永久链接时遇到了可怕的“未指定输入文件”错误,但我认为这是 WordPress 问题,而不是重写模块问题。我在 IIS7 和 WP 3.4.2 上。漂亮的固定链接是:

http://www.mydomain.com/blog/2012/09/20/post-name/

并且这是正确的重写到:

http://www.mydomain.com/blog/index.php/2012/09/20/post-name/

我认为重写是正确的,因为当我手动转到后一个 url 时,我仍然得到错误。所以我认为问题在于WordPress。不过,为了完整起见,这里是重写规则:

   <rule name="Main Rule" stopProcessing="true">
      <match url="^blog/(.+)" />
      <conditions logicalGrouping="MatchAll">
        <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
      </conditions>
      <action type="Rewrite" url="/blog/index.php/{R:1}" />
    </rule>

在 SO 上有很多关于这个问题的帖子,但它们似乎都是重写问题,所以我不认为这是问题所在的任何问题的重复我有。

【问题讨论】:

    标签: wordpress


    【解决方案1】:

    嗯,这是一个重写问题,有点。在上面的模式中,我没有考虑到站点在共享主机上,/blog 实际上指向的是\subfolder\blog。更改如下修复它:

       <rule name="Main Rule" stopProcessing="true">
          <match url="^blog/(.+)" />
          <conditions logicalGrouping="MatchAll">
            <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
            <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
          </conditions>
          <action type="Rewrite" url="/subfolder/blog/index.php/{R:1}" />
        </rule>
    

    这并不理想,因为我必须硬编码子文件夹的名称,但现在,我会接受它。

    【讨论】:

      猜你喜欢
      • 2020-08-04
      • 1970-01-01
      • 2013-03-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-01-30
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多