GenerateIt

Error Page Generator

This tool allows you to generate custom error pages for your website, helping you provide a more user-friendly experience when visitors encounter an issue. Custom error pages can be used to display helpful messages for common errors such as 404 Not Found, 403 Forbidden, or 500 Internal Server Error, instead of showing a generic server message.

To get started, simply enter the location of your custom error pages into the fields below and click “Generate It.” Be sure that each path begins with a leading slash (/), as this tells the server where the error page is located relative to your website’s root directory.

Once generated, copy and paste the resulting code directly into your .htaccess file to activate the custom error handling on your site.

Important: If an incorrect or invalid path is entered, it may trigger a 500 Internal Server Error, which can prevent your website from loading correctly. Always double-check your file paths and test your configuration after making changes.

If this site has been useful, we’d love your support! Consider buying us a coffee to keep things going strong.

Buy me a coffee

Path To Error Page

Optional. {code} becomes the error number. Or type each path yourself (i.e. /404.htm or /custom/404.htm).

Server type

Everything is built in your browser and nothing is sent anywhere. Only error codes 400 and above are listed, because that is what an error page can be set for. Upload your error pages before you add the code.

How to use it

The error page generator makes it simple to create the necessary code for error pages that you copy in to your htaccess file.

  1. Pick your pagesWork out which error pages you need and upload the pages to your server.
  2. Enter the pathsEnter the link location in to the form above for your needed error pages.
  3. GenerateClick on ‘Generate’ for the code to be produced.
  4. Copy and pasteCopy and paste the generated code in to your htaccess file.

Good to know

Start with a slash

Use a path such as /404.html. A path without the leading slash is not understood by the server.

A wrong path gives a 500

If the file is missing or the path is wrong, visitors may see a 500 error. Test after every change.

Do not use a full address

A full web address makes the server redirect the visitor, so search engines see a 302 and not the real error.

Frequently asked questions

Where do I put the code?

On Apache, add the lines to the .htaccess file in the root folder of your website. Make a backup copy first. On Nginx, the lines go inside the server block of your site configuration, and Nginx must be reloaded.

Why did my site show a 500 error after adding it?

Most often the path is wrong, the page does not exist, or .htaccess contains a typo. Remove the new lines, then check each path against the real location of the file.

Why are 301 and 302 not in the list?

They are redirects, not errors, and an error page cannot be set for them. To redirect a page, use Redirect or RewriteRule, which our Mod Rewrite Generator can write for you.

Does the error page need to be an html file?

No, it can be any file on your site, such as a .php page. The visitor still receives the correct error code, as long as the path starts with a slash.

How can I check it works?

Visit an address that does not exist, for example a made-up page, and see if your page appears. Then use the HTTP Header Viewer to confirm the status is still 404 and not 200 or 302.

Is anything stored or sent?

No. The code is made in your browser and the paths you type never leave your device.

Related tools

HTTP Headers

View the headers of the site of your choice, exactly what your browser reads.

Redirect Checker

Seamlessly analyze and track the complete path of URL redirects.

If this site has been useful, we’d love your support! Consider buying us a coffee to keep things going strong.

Buy me a coffee