WordPress 永久链接在 godaddy 中显示 "You should update your web.config now."

Wordpress permlink show "You should update your web.config now." in godaddy

在Godaddy wordpress 站点不显示内页,它只显示主页和wordpress 管理页面。单击 "Permalink Settings" 中的保存更改时,它显示 "You should update your web.config now." 当我在我的站点中添加 web.config 时,它显示 500 错误(主页和管理页面也一样)现在该怎么办?修复 500 错误或修复 404 错误以及如何修复?请帮助我。 我的 .htaccess 文件在下面

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [L]
</IfModule>

# END WordPress

您正在使用 windows 服务器,因此您需要 web.config 在 wordpress 的根文件夹中,

如果在根文件夹中找不到 web.config,则添加 web.config 文件并将下面的代码添加到其中,

<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <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>
            </rules>
        </rewrite>
        <staticContent>
            <remove fileExtension=".svg" />
            <mimeMap fileExtension=".svg" mimeType="image/svg+xml" />
        </staticContent>
        <defaultDocument>
            <files>
                <remove value="index.aspx" />
                <add value="index.php" />
            </files>
        </defaultDocument>
    </system.webServer>
</configuration>

根文件夹是指包含wp-content、wp-includes等的文件夹,

如果万一主页抛出 500 错误,请尝试删除整个 <defaultDocument> 标记部分

<defaultDocument>
    <files>
       <remove value="index.aspx" />
       <add value="index.php" />
    </files>
</defaultDocument>

我遇到了同样的问题,内部页面工作正常,但主页抛出 500 错误。我通过编辑 web.config 文件让主页正常工作 - 删除标签和其中的所有内容。