Bluehost Web Hosting Help

Manually editing your error pages

Summary

This article explains how to manually customize your html or php error pages.


Customizing your error pages

When manually editing your .htaccess file you will need to add the following entry to fit your site:

ErrorDocument error-number /Your-Error-file.html

For example if I had the file notfound.html in the root directory of my site and I wanted to use it for a 404 error I would use:

ErrorDocument 404 /notfound.html

The other way is a work-around. But works really well. It just redirects the old error page to the new error page.

Make an error page such as Errorpage1.shtml. Then fill out this .htaccess redirect entry.

RewriteEngine On
            RewriteBase /
            RewriteCond %{REQUEST_URI} ^$
            RewriteCond %{HTTP_HOST} ^domain.com/400.shtml$
            RewriteRule ^$ http://domain.com/errorpage1.shtml [L,R=301]
            
Knowledgebase Article 163,046 views bookmark tags: errors php


Was this resource helpful?

Did this resolve your issue?


Please add any other comments or suggestions about this content:





Recommended Help Content

Error Pages

This article explains error pages and how they can be customized.

PHP pages do not display

If suddenly when you go to your page, you get nothing on the page. You can still get HTML to display, just not PHP. To serve HTML pages to browsers, we don't associate the Apache processes with your 2

How To Add Handlers To Change PHP Version - PHP Version Setup

This article will explain how to add a PHP handler to your .htaccess files. This is useful if you want to customize the version of PHP that runs your PHP files.

Related Help Content

PHP display_errors flag

How do I turn the display_errors flag on for php?

500 Internal Server Error when trying to install something with MOJO Marketplace

500 Internal Server Error when installing via the MOJO Marketplace installer.

Redirects that do not work due to PHP variables

The redirection of www.yourdomain.com/default.html or index.html to http://www.yourdomain.com/index.php?act=whatever redirects it to http://www.yourdomain.com/index.php%3fact=whatever In other words,

MySQL Error Messages

This article will show a few MySQL errors along with explanations as to why they might be occurring.

Executing PHP code within an HTML document

Executing php code within a HTML document

Error Code 500 on Dedicated and VPS Servers

This article will explain some common causes for 500 errors on Dedicated or V.P.S servers.

Character sets in PHP

How to Set different character sets with PHP and HTML to display correctly.

Protect Specific Pages With SSL

This article will show a way to protect specific pages of your website with SSL. This may have benefits for SEO and can be used on pages that contain forms, shopping carts or any other page where users might enter sensitive information.