第404页wordpress没有触发

时间:2015-01-14 07:05:14

标签: wordpress

我已经安装了404个插件,我甚至有一个404页面,但我不知道为什么它没有显示。 我的网站是一个页面网站,当它显示它显示的404页面时:

Not Found

The requested URL /asd was not found on this server.

Apache/2.2.15 (CentOS) Server at mysite.com Port 80

我该怎么做才能解决这个问题?

2 个答案:

答案 0 :(得分:1)

您需要在.htaccess文件中添加错误页面的处理程序

例如在htaccess文件中添加以下代码:

ErrorDocument 404 /your404page.php

答案 1 :(得分:1)

首先检查WordPress根文件夹中是否有.htaccess文件(包含wp-config.php文件的文件夹)。如果它丢失了,请将以下文本(source)复制到WordPress根文件夹中名为.htaccess的新纯文本文件中。另外,make sure this file is readable by Apache0644的权限应该足够了。)

# 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

如果这没有帮助,那么您的Apache服务器不支持使用RewriteRule指令。这很可能是因为没有为您的特定域启用mod_rewrite。要解决此问题,您需要编辑Apache配置文件并将此行添加到适用于您的域的配置语句中:

Options +FollowSymLinks

Apache配置文件的位置可能因主机设置而异,但请尝试在httpd.conf中查找名为/etc/httpd/conf/的文件。

检查服务器的错误日志。那里可能有一些有用的信息。