0

I have installed 404 plugins, I even have a 404 page but I don't know why it is not showing. My website is one page website and when it should display the 404 page it shows :

Not Found

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

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

What can I do to solve this?

Florin Pop
  • 5,105
  • 3
  • 25
  • 58

2 Answers2

1

you need to add handler for error page in .htaccess file

for example in htaccess file add this code:

ErrorDocument 404 /your404page.php
1

First check that you have a .htaccess file in your WordPress root folder (the one that contains your wp-config.php file). If it's missing, copy the following text (source) into a new plain-text file called .htaccess in the WordPress root folder. Also, make sure this file is readable by Apache (permissions of 0644 should suffice).

# 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

If that doesn't help, then your Apache server doesn't support the use of RewriteRule directives. This is most likely because mod_rewrite isn't enabled for your particular domain. To fix this, you need to edit the Apache configuration file and add this line to the configuration statements that apply to your domain:

Options +FollowSymLinks

The location of the Apache configuration files can vary depending on your hosting setup, but try looking for a file called httpd.conf in /etc/httpd/conf/.

Check your server's error log too. There might be some useful information in there.

Community
  • 1
  • 1
r3mainer
  • 23,981
  • 3
  • 51
  • 88
  • I added the .htaccess file and now when I put something like mypage.com/somethinghere it goes to mypage.com. How can I send the user to another page? for example mypage.com/404 – Florin Pop Jan 14 '15 at 11:05
  • You don't need to redirect to a different page. The page management is all done inside WordPress. When you visit `mysite.com/2015/01/`, for example, the .htaccess file redirects this request to `/index.php`. WordPress then examines the original request URI to decide what page to send back to the client. So for example `/2015/01/` might bring back a list of all the articles published this month. If WordPress can't find the requested item, it will reply using the file `404.php` inside the home directory of your current theme. – r3mainer Jan 14 '15 at 11:21