ajax错误返回404_如何修复返回404错误的WordPress帖子

ajax错误返回404

WordPress is a powerful CMS. Sometimes a slight tweak can make your website inaccessible. However, finding a solution for any WordPress problem is extremely easy (check out how to properly ask for WordPress support and get it). In the past we have covered some of the most common problems WordPress users face. Like the internal server error or error establishing database connection. Another common problem that most WordPress users face at some point is WordPress posts returning a 404 Error. In this article we will show you how to fix WordPress posts returning 404 error.

WordPress是功能强大的CMS。 有时稍作调整会使您的网站无法访问。 但是,找到任何WordPress问题的解决方案都非常容易(请查看如何正确地寻求WordPress支持并获得 )。 过去,我们介绍了WordPress用户面临的一些最常见的问题。 如内部服务器错误建立数据库连接错误 。 大多数WordPress用户有时会遇到的另一个常见问题是WordPress帖子返回404错误。 在本文中,我们将向您展示如何修复返回404错误的WordPress帖子。

Fixing WordPress posts returning 404 error

Usually in this scenario a user can access their WordPress admin area, their blog’s main page, but when accessing a single posts they get a 404 Not found error. First of all, don’t panic most of the time your posts are still there and completely safe. This usually happens if your .htaccess file got deleted or something went wrong with the rewrite rules. What you need to do is fix your permalinks settings.

通常,在这种情况下,用户可以访问其WordPress管理区域(即博客的主页),但是在访问单个帖子时会收到404 Not found错误。 首先,大部分时间不要惊慌,您的帖子仍然在那里并且完全安全。 如果您的.htaccess文件被删除或重写规则出了问题,通常会发生这种情况。 您需要做的是修复永久链接设置。

影片教学 (Video Tutorial)

演示地址

If you don’t like the video or need more instructions, then continue reading.

如果您不喜欢该视频或需要更多说明,请继续阅读。

Go to Settings » Permalinks, and simply click on Save Changes button.

转到设置»永久链接 ,然后只需单击保存更改按钮。

Update permalink settings

This will update your permalinks settings and flush rewrite rules. In most cases this solution fixes the WordPress posts 404 error. However, if it does not work for you, then you probably need to update your .htaccess file manually.

这将更新您的永久链接设置和刷新重写规则。 在大多数情况下,此解决方案可修复WordPress的404错误。 但是,如果它对您不起作用,则可能需要手动更新.htaccess文件。

Login to your server using FTP, and modify the .htaccess file which is located in the same location where folders like /wp-content/ and /wp-includes/ are located. The easiest thing you can do is to temporarily make the file writeable by changing the permissions to 666. Then repeat the original solution. Don’t forget to change the permissions back to 660. You can also manually add this code in your .htaccess file:

使用FTP登录到服务器,然后修改.htaccess文件 ,该文件位于/ wp-content /和/ wp-includes /等文件夹所在的位置。 您可以执行的最简单的操作是通过将权限更改为666来临时使文件可写。然后重复原始解决方案。 不要忘记将权限更改回660。您还可以在.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

本地服务器修复 (Fix for Local Servers)

Often designers and developers install WordPress on their computers using a local server for testing purposes. If you want to use pretty permalinks, then you need to enable the rewrite_module in the Apache configuration of your MAMP, WAMP, or XXAMP.

通常,设计人员和开发人员使用本地服务器在其计算机上安装WordPress以进行测试。 如果要使用漂亮的永久链接,则需要在MAMP,WAMP或XXAMP的Apache配置中启用rewrite_module。

We hope this article helped you resolve posts returning 404 error in WordPress. Did this solution work for you? Do you have another solution that worked for you? Please share it in the comments below. We would like to make this article a comprehensive resource for users who run into this issue.

我们希望本文能帮助您解决WordPress中返回404错误的帖子。 这个解决方案对您有用吗? 您还有其他适合您的解决方案吗? 请在下面的评论中分享。 我们希望使本文成为遇到此问题的用户的全面参考。

翻译自: https://www.wpbeginner.com/wp-tutorials/how-to-fix-wordpress-posts-returning-404-error/

ajax错误返回404

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值