【问题标题】:issues in configuring WordPress website on window server在窗口服务器上配置 WordPress 网站的问题
【发布时间】:2016-04-13 21:46:14
【问题描述】:

我已将我的 WordPress 网站移至窗口服务器,但我遇到了问题。如果我将此代码的代码放在 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.19 HTTP 500.19 内部服务器错误配置无效 如果我从 web.config 中删除此代码,则网站仅适用于以 index.php 开头的永久链接,例如 index.php/opening-时间/

我已经搜索过这个问题,但无法解决

【问题讨论】:

  • 除非你需要 COM,否则永远不要在 windows 上托管
  • 请检查IIS服务器重写模块默认是禁用的,所以如果它被禁用就启用它

标签: php wordpress configuration web-config window-server


【解决方案1】:

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

【讨论】:

  • 如果我删除 index.php,它会给出错误 404 页面未找到
【解决方案2】:

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

您也可以参考此链接来配置服务器 wordpress 永久链接

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>

【讨论】:

  • HTTP 错误 500.19 - 内部服务器错误 请求的页面无法访问,因为该页面的相关配置数据无效。
  • 请检查IIS服务器重写模块默认是禁用的,所以如果它被禁用就启用它
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-05-06
  • 2020-10-27
  • 2015-10-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多