在Godaddy wordpress网站没有显示内页,它只显示主页和wordpress管理页面.单击“永久链接设置”中的保存更改时,它会显示“您应该立即更新您的web.config”.当我在我的网站中添加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服务器,所以你需要在wordpress的根文件夹中的web.config,
如果在根文件夹中找不到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等的文件夹,
原文地址:https://codeday.me/bug/20190910/1801862.html
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。