If you want to create custom Error page with .htaccess then follow this article. In this article we will guide you how you can create Custom Error Page with .htaccess.
There are different type of errors:
- 400 – Bad request
- 401 – Authorization Required
- 403 – Forbidden
- 404 – Not Found
- 500 – Internal Server Error
Now open your .htaccess file and add this code into your file.
RewriteEngine On ErrorDocument 400 /404.php ErrorDocument 401 /401.php ErrorDocument 403 /403.php ErrorDocument 404 /404.php ErrorDocument 500 /500.php
You can change the page name according to your needs or whatever you want. In this example all pages are in root folder and .htaccess file should be in root folder.