【问题标题】:Wordpress Permalinks on IIS causes Error 500IIS 上的 Wordpress 永久链接导致错误 500
【发布时间】:2014-08-12 12:06:05
【问题描述】:

好的,我一直在网上到处搜索,虽然有一些匹配,但它并没有解决我的问题。我在 Windows 2012 上使用 Wordpress 3.9、PHP 5.4.14、IIS8,并且安装了 URL Rewrite mod 版本 2。 每当我在我的 WordPress 网站 (/%category%/%postname%/) 中打开永久链接时,我都会收到以下错误(这是在服务器上。从客户端,附加信息被隐藏):

内部服务器错误 500.0
C:\PHP\v5.4\php-cgi.exe - FastCGI 进程意外退出
模块:FastCgiModule
通知:ExecuteRequestHandler
处理程序:PHP54_via_FastCGI
错误代码:0x000000ff

在浏览我的网站时甚至在 wp-admin 中工作时都会发生此错误。但是,如果我点击刷新几次,最终页面会加载(在大多数情况下)。然后我也许可以在错误再次发生之前导航到另外几页,但似乎每次导航到博客文章时都会发生错误。 我尝试了以下两个 web.config 文件,结果都相同。

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system.webServer>
    <rewrite>
      <rules>
      <rule name="wordpress" patternSyntax="Wildcard">
          <match url="*"/>
            <conditions>
              <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true"/>
              <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true"/>
            </conditions>
            <action type="Rewrite" url="index.php"/>
        </rule>
      </rules>
    </rewrite>
  </system.webServer>
</configuration>

还尝试用我在其他线程中找到的规则替换规则,但上面的规则是由 WordPress 生成的:

<rule name="Main Rule" stopProcessing="true">
  <match url=".*" />
    <conditions logicalGrouping="MatchAll">
      <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
      <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
    </conditions>
    <action type="Rewrite" url="index.php" />
</rule>

【问题讨论】:

    标签: wordpress iis permalinks internal-server-error


    【解决方案1】:

    你能试试这个吗?

    <?xml version="1.0" encoding="UTF-8"?>
    <configuration>
    <system.webServer>
    <rewrite>
    <rules>
    <rule name="WordPress Rule" stopProcessing="true">
    <match url=".*" />
    <conditions>
    <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
    <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
    </conditions>
    <action type="Rewrite" url="index.php?page_id={R:0}" />
    </rule>
    </rules>
    </rewrite>
    </system.webServer>
    </configuration>
    

    【讨论】:

      【解决方案2】:

      最后似乎我得到了它的工作。我正在使用 Brandoo Wordpress 项目来利用 MS SQL Server。

      所以我首先在一个空白站点上安装了 Project Nami,然后从我以前的站点复制所有插件并更新配置文件以连接到我的原始数据库。最后将我的 PHP 升级到 5.5.15 版本。它现在似乎工作正常。

      ---- 更新
      好的,似乎只需升级到 PHP 5.5.15 就可以解决问题。不是我的第一选择,因为没有可用的官方 PHP SQL 驱动程序,但是嘿……它完美无缺。

      【讨论】:

        【解决方案3】:

        我遇到了同样的错误,虽然我没有尝试更新 PHP,但对我有用的是 https://codex.wordpress.org/Using_Permalinks 结尾附近描述的内容:

        "(...) 你可以试试 PATHINFO 永久链接;把 index.php/ 放在开头 您的自定义永久链接结构:"

        /index.php/%year%/%monthnum%/%day%/%postname%/
        

        通过这样做,我不必触摸 web.config 文件。

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2012-08-30
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多