Custom Error Pages

Definitely not a comprehensive list just yet

## Begin Error Document Redirection
ErrorDocument 400 /400.html
ErrorDocument 401 /401.html
ErrorDocument 403 /403.html
ErrorDocument 404 /400.html
ErrorDocument 500 /500.html

Wordpress Custom Error Documents

First you’ll need to make sure that you have the 404.php file in your wp-content/themes/(yourtheme) folder.

Most of the time wordpress will pull up this 404 file if it can’t find a post, but if you’re wordpress is not behaving then let’s move on.

Let’s turn your 404 document into a wordpress template, add this line to the top of your 404.php file

<?php
/*
Template Name: 404 Error
*/
?>

Now create a new PAGE from your wordpress admin panel and call it 404 Error. If you’re using your permalinks then you’ll see the new link to your error page, it will look something like. http://www.jonathonbyrd.com/404-error

Finally, in your .htaccess file you’re custom error code will need to reflect this new URL:

## Begin Error Document Redirection
ErrorDocument 400 /404-error

If this did or did not work for you let me know.



Leave a Reply

Enter Your Comment: