在Windows服务器上配置WordPress网站时出现的问题


issues in configuring WordPress website on a Windows server

我已经将我的WordPress网站移到了Windows服务器上,但我遇到了一个问题。如果我将此代码放在web.config 中

<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>

则网站给出错误500.19HTTP 500.19内部服务器错误配置无效

如果我从web.config中删除了这段代码,那么网站只适用于以index.php开头的永久链接,如index.php/opening-timings/

我建议您按以下方式使用,但请确保您在IIS服务器上启用了重写规则模块,因为默认情况下它处于禁用阶段。

你也可以参考这个链接来配置服务器wordpress Permalinks

http://www.iis.net/learn/extensions/url-rewrite-module/enabling-pretty-permalinks-in-wordpress

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system.webServer>
    <rewrite>
      <rules>
        <rule name="wordpress" 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>
          </rules>
        </rewrite>
      </system.webServer>
    </configuration>

设置选项卡的管理端更改永久链接格式,点击永久链接。从格式中删除index.php。则URL将不带index.php.