University at Buffalo - The State University of New York
Skip to Content

Error Page Customization on Wings

No matter how much you plan for your site, things can still go wrong. Learn how to handle broken links and other errors on your site with customized error pages.

Common Errors Visitors May Encounter on Your Site

  • File not found (404) – Displayed when a visitor either follows a bad link or types in a Web address that does not exist on your site
  • Unauthorized (401) – Displayed when a visitor tries to access a protected page without logging in
  • Internal server error (500) – Displayed as a “catch-all” by the Web server when something has gone wrong, but it is not sure exactly what

Why Create Custom Error Pages?

The default error page for Wings tells your visitor that the Web page wasn't found, or that there was an error, but doesn't provide any more help than a few basic links. The Wings page’s style also will not match the style of your site. With your own error pages, you have the opportunity to provide helpful navigation, give support contact information and maintain your site’s visual consistency.

Creating Custom Error Pages

  1. Create an HTML page for each of the error types listed above. Give each a meaningful file name, such as “error404.html” and “error500.html.”
  2. Upload the custom error page(s) to your site (if necessary).
  3. Create (or modify) an .htaccess file and place it at the top level of your Web directory with the following contents:
ErrorDocument 404 /PATH_TO_YOUR_CUSTOM_PAGE/error404.html
ErrorDocument 500 / PATH_TO_YOUR_CUSTOM_PAGE/error500.html
  • If your URL is, then your .htaccess file would contain the line:
ErrorDocument 404
  • If your URL is a virtual host, like, then your .htaccess file would contain the line:
ErrorDocument 404 /error404.html


If things don't work correctly, first check your permissions. You may need to make the .htaccess and error files readable:

chmod u+rwx,g+rx,o+rx .htaccess
chmod u+rwx,g+rx,o+rx error404.html

You may also want to add a blank line at the end of the .htaccess file.

Contact the UBIT Help Center

Have a UBITName? You may also use the UBIT Help Center Online (login required).

(xxx) xxx-xxxx
Use your email, if known