1and1 Help Centre Categories

print article

Create Custom Error Pages (Linux)

For Linux hosting packages and managed servers

In this article you will learn how to create your own custom error pages that will replace the default (404, 403, 500) error pages.

Follow the steps below in order to set up custom error pages.

Step 1
Create the custom error page.
Step 2
Save the custom error page.
Step 3
Upload the custom error page to your web space.
Step 4
Specify the path to the custom error page in the .htaccess file.
Step 5
Disable Empty Pages Parking.
Common Errors
Error Number Error Description
400 Bad Syntax
403 Forbidden
404 Not Found
500 Internal Error

Reference the example below for the format to use. Each new line must start with "ErrorDocument" followed by a space and then the error number. Leave another space after the error number and then specify the URL for the error page to use.

ErrorDocument 400 http://www.your_domain.com/errorDocs/400.html
ErrorDocument 403 http://www.your_domain.com/errorDocs/403.html
ErrorDocument 404 http://www.your_domain.com/errorDocs/404.html
ErrorDocument 500 http://www.your_domain.com/errorDocs/500.html
Please note:
This .htaccess method does not work for PHP files.

Save the .htaccess file in the root of your webspace. If you already have a .htaccess file in the root of your webspace, do not overwrite the file but edit the existing one instead. If you are creating/editing the file on a Windows machine, use a basic text editor like Wordpad or Notepad. Save the file as htaccess.txt first and then upload the file to the root of your webspace. Once uploaded, you can then rename the file to .htaccess.

For additional information, you may want to reference: