Custom error pages code generator

Set your custom error pages using htaccess. Create a page just like any other, with a message like 'sorry, the page you are looking for cannot be found' (404) or 'there is a problem running this script' (500). Upload your custom pages to your website and use the generator below to create the code to place into your .htaccess file.
  • Create custom HTML pages for each error code you wish to use - page not found, internal server error, etc. It's easier if you call them '404.html' or '500.html' etc so you can identify them later.
  • Upload the custom pages to your website. They can either be in the root folder for your domain, or in a sub-folder.
  • Enter the path to the error page including the leading slash from domain root - the main folder where your website pages are stored.
  • Copy the code and paste it into notepad and save it as htaccess.txt. Upload it in ASCII format to the root folder for your domain (ie, where the user goes to when they first enter your site) and rename it to .htaccess (remember the dot!!)
  • Unless you have your FTP program set to show invisible files, the file may disappear from sight. Don't worry, it's still there!
  • If you have an existing .htaccess file, copy and paste the generated code into that.
  • If you are using this code on a subdomain where the folder for the subdomain is within the main domain's folder, you may find that it doesn't work. . If you experience issues with displaying the page, you can also use a full url (ie, https://sub.domain.com/errorpage.html).

 
Custom error pages
Error code
Path to custom page
(ie: /404.html or /custom/404.html)
301 Moved Permanently:
302 Moved Temporarily:
404 Not Found *:
500 Internal Server Error *:
503 Service Unavailable *:
504 Gateway Timeout:
505 HTTP Version Not Supported:
400 Bad Request *:
401 Authorization Required *:
403 Forbidden *:
405 Method Not Allowed:
408 Request Timed Out:
415 Unsupported Media Type:
501 Not Implemented:
502 Bad Gateway:
504 Gateway Timeout:
505 HTTP Version Not Supported:
Share the Custom error pages code generator on Facebook