How do I use my own error pages on PHP hosting?

In some cases, it may be relevant to set your own error pages for various errors on your web site. The most common one is the "Not found" error page, shown when someone tries to access an URL that does not exist.


You can specify the document that is to be shown when you encounter an error by using your web site's .htaccess file:

ErrorDocument 404 /file.html

In our example we used the file name file.html. You need to change it to the name of the file you want to be displayed instead of the default error page.


You can do the same for other error codes than 404 by typing the number of the error code you want in the code.

In order to modify the .htaccess file, you first need to open it for editing, or to create a new file if you don't have one already. See this guide for more information about how to do that

Should you not find what you are looking for then feel free to ask our support

Create A Ticket
Service Desk
Are you facing bigger challenges which requires a bit more know-how and time than you have?

Surftown Service Desk is services where we do the work to you. Our Service desk will get the job done.

Do it for me