Error Page Template

The error page template allows you to modify the appearance of the server error pages (HTTP error messages), for example, 404 File not Found or 500 Internal Server Error.

This template affects neityher the appearance of the patience page (the page displayed when users request a large file download), nor the various notification pages that the Web Appliance displays to users when they try to access:

  • virus-infected files
  • malware
  • blocked sites
  • sites or applications that violate policy
  • restricted sites
  • unapproved secure sites

This template has very few required elements, and it provides a set of optional page element keys. Apart from HTML requirements and the page element keys that are required for the appliance's administrative web interface, you are free to use or remove any of the optional page element keys provided by the template and to modify the template as much as you like.

Right-click this link and select "Save Link As" or "Save Target As" to download the Error Page Template.

Important
If you plan to use a custom template, it is strongly recommended that you download the Sophos template, available from the preceding link, rather than using a template from another source. Sophos cannot be held responsible for any malicious or problematic code included in other templates or introduced in added code. Realize that such malicious or problematic code could be distributed to many of your users if included in a custom template and, therefore, exercise caution.

Required Elements

The following elements are required:

  • DOCTYPE Declaration: The provided HTML DOCTYPE declaration of XHTML 1.0, Strict, is required. You should not change this.
  • <div id="main" class="[full|mini]"> ... </div>: This <div> tag can be used with the class attribute set to full. It will be automatically set to mini when the page is shown in an iframe. By default, the full option displays any graphics within these tags and contains no iframe layout settings. By default, the mini option hides any graphics within this tag and includes iframe layout settings, making this section full page width. The CSS settings controlling these options can, however, be modified.

    This tag must wrap the visible content of the notification page, with the exception that banner or background images may be placed before this <div> tag.

  • %%sophos_error_content%%: This page element key must appear after the <div id="main" class="[full|mini]"> ... </div> tags and immediately before the closing </body> tag. This content includes text entered in the Text explanation text box.
Note
Server-side scripting is not supported within this error page template.

Optional Elements

The following page element keys are available, or can be used, depending upon your preference:

  • Client-side scripting: You may add client-side scripting, such as JavaScript.
  • %%title%%: It is suggested that you use this in the <head> section of the template. It provides the appropriate <title> for the error pages. Also, this page element key can also be used within the <div id="main" class="[full|mini]"> ... </div> tags of the template. In this location, it provides the appropriate in-page heading for the error pages. As this key is replaced with plain text, you may choose to wrap it in a div or heading tag; for example:
    <h1>%%title%%</h1>
    This content is drawn from text entered in the Page title text box.
  • %%server_address%%: This page element key provides the fully qualified domain name (FQDN) of the Web Appliance. It is an essential initial part of the URL for any of the Sophos-supplied graphics, but the use of these is optional. If you continue to use any of these graphics, you must retain this page element key, as well as the rest of the URL for the graphic, /resources/images/[filename.ext]. For example:
    %%server_address%%/resources/images/SophosImageFile.jpg
  • %%image_asset%%: This page element key is used as the base URL for any graphic that you have uploaded in the Images section of the Advanced tab in the Configuration > Accounts > Notification Page Options page. You must complete this URL by adding a slash (/) and the full filename of the uploaded graphic, for example:
    %%image_asset%%/MyImageFile.jpg
  • %%logo%%: This page element key calls the logo set in the Global Options tab of the Configuration > Accounts > Notification Page Options page. Note that the Display logo on notification pages option must be enabled on the Global Options tab for this page element key to work.
  • %%heading%%: This page element key may be used within the <div id="main" class="[full|mini]"> ... </div> tags of the template. It displays the appropriate server error. As this key is replaced with plain text, you may choose to wrap it in a div or heading tag; for example:
    <h1>%%heading%%</h1>
  • %%error_text%%: This page element key may be used within the <div id="main" class="[full|mini]"> ... </div> tags of the template. It gets replaced with a string in the form <p id=”error_text”>the error text is here</p> that displays the explanatory text for the appropriate server error provided by Sophos, and it appends any additional text sent by the server that originates the error.