How can I make my own "error pages"? Print

  • 9

Create an html or shtml page that looks like and says what you want it to. Click "Error Pages " icon. The process is almost step-by-step and "almost" self-explanatory. Click on whichever error page you want to customize. It will take you to a big text box, copy the entire HTML code of the custom error page you created and paste it all into the text box, then click "Save". There are a few tricks to success however:

  1. Make sure that everything in your page code uses the entire url, including image sources. If you're using stylesheets or JavaScripts, make sure that they also use the entire url in the call:

    instead of simply < img src="images/imagename.jpg" alt="" />,

    and so on. Or you could simply put your styles right into the body of the page, ditto with the JS unless it's one that must be placed between and tags.

  2. The code for the Error page must be at least 10Kb or it won't display properly in Internet Explorer. It's just one of IE's quirks. An easy workaround if you don't want your error page to ramble on and on is to simply put a bunch of other "stuff" within comment tags somewhere in your page. That way it won't show up when displayed in a browser. Comment tags are , with the placed after. Anything you have between these two tags will not be displayed in a browser.?For example:

  3. In your cPanel when you select the Error Page you want to edit, you will find above the edit text box several buttons:
    • Referring URL
    • Visitor's IP address
    • Requested URL
    • Server Name
    • User's Browser
    • Status Code

    These are things you can insert into the code of your page to customize it even further. For example if you choose "Requested URL", it will give you code to insert into your page so that the URL requested by the visitor is displayed on the page.

    To the left of these buttons is another button that says "Click to Insert". Now this is a little misleading. When you click to insert, it will NOT insert anything where you have your curser. I wish it did but it won't; it's a cPanel quirk. It will instead insert the code just after or just before any code you have entered in the text box. The "inserted" bit of code will look something like this: although the "REQUEST_URI" may be replaced by something else depending on what you selected. Look for it at the very beginning or very end of your pasted code and then cut/paste it into the proper spot in your html code.

  4. Make your custom error page/s interesting and helpful. Give visitors information they can use to navigate your site: Links, a menu, email address for help or support, etc. A bit of humor can be fun too, if it fits in with your site, by taking some of the edge off people's frustration when they get an error page.

  5. And of course it would be best to coordinate your error page/s with your site, at least to some extent.

Was this answer helpful?

« Back

Powered by WHMCompleteSolution