Create custom ErrorDocuments in HTML
by MrUnknown on Mar 21, 2011Views: 25 | Likes: 1 | Dislikes: 0
In this tutorial we will create custom ErrorDocuments in HTML with .htaccess
Share This Tutorial
Add the following code to your .htaccess file:
Code Example:
# You can change the *.html to .php or .asp if you like
ErrorDocument 401 /401.html # Unauthorized
ErrorDocument 403 /403.html # Forbidden
ErrorDocument 404 /404.html # Not Found
ErrorDocument 500 /500.html # Internal Server Error
ErrorDocument 401 /401.html # Unauthorized
ErrorDocument 403 /403.html # Forbidden
ErrorDocument 404 /404.html # Not Found
ErrorDocument 500 /500.html # Internal Server Error
P.S. Make and edit the files in the code as you want them, the files are in the root_dir of your site
You can also make a ErrorDocument like this:
Code Example:
# Not Found ErrorDocument
ErrorDocument 404 "<html><head><title>Page not Found</title></head><body><h2>Sorry, the page you requested was not found.</h2></body></html>
ErrorDocument 404 "<html><head><title>Page not Found</title></head><body><h2>Sorry, the page you requested was not found.</h2></body></html>
Share This Tutorial


