Set up your own 404 error page for your website
Related Videos: Create a Custom 404 Error Page for Your Site (May 2024).
Here we show you how to set up your own 404 error page for your website. Usually, if the URL is incorrect, only a standardized notice from your host will appear.
Create 404 error page
The error page should be adapted to the design of your normal website. This looks so much more professional than the standard error message. You should also note the following:
- On the page, indicate why users see this page. For example, that an incorrect URL was entered. However, if the users followed a wrong link on your website, you can, for example, insert a "Report a bug" link for sending e-mails here. This enables users to inform you about link errors on your website straight away.
- The 404 page should also include a link to your homepage and / or links to popular content on your website. In this way you prevent users from leaving your website simply because it doesn't seem to be going any further. You can also integrate your site search here.
- Finally save the file on your web server in a new folder "404" as "index.html".
- We give you examples of curious and successful error pages on the web in this picture gallery.
Edit .htaccess file
Now you have to edit the .htaccess file. In addition to linking for error pages, you can also create access protection for certain directories here.
- Write the following line into a new file: "ErrorDocument 404/404 /" This ensures that the previously created file is assigned to the 404 error.
- Since this setting only applies to the directory in which the .htaccess file is located, save it in the same folder as your home page. You only call this file ".htaccess", there is no file extension like ".html" or ".php".
Here you can find out how to incorporate structured data on your website and thus appear prominently in Google's search results.