A Simple Method To Create Custom Error Pages
The first use of the .htaccess file which I will cover is custom error pages. These will allow you to have your own, personal error pages (for example when a file is not found) instead of using your host’s error pages or having no page. This will make your site seem much more professional in the unlikely event of an error. It will also allow you to create scripts to notify you if there is an error.
You can use custom error pages for any error as long as you know its number (like 404 for page not found) by adding the following to your .htaccess file:
ErrorDocument errornumber <FILE NAME>
For example if I had the file notfound.htm in the root direct
ory of my site and I wanted to use it for a 404 error I would use:
ErrorDocument 404 /notfound.htm
If the file is not in the root directory of your site, you just need to put the path to it:
ErrorDocument 500 /errorpages/500.htm
These are some of the most common errors:
401 – Authorization Required
400 – Bad request
403 – Forbidden
500 – Internal Server Error
404 – File Not Found
Then, all you need to do is to create a file to display when the error happens and upload it and the .htaccess file.
Incoming search terms:
- autocapital ising in java (2)
- custom error pages using htaccess 1 0 software (2)
- 404 error page htaccess (1)
- Xampp custom Error Pages (1)
- wp custom error pages (1)
- what are custom errors interview question (1)
- php custom error pages xampp (1)
- jquery ajax custom error pages htaccess (1)
- how can i change custom error page in xampp (1)
- firefox ezpdf \ (1)
- custom professional jquery 404 page (1)
- custom error page in xampp (1)
- xampp htaccess custom 404 (1)
You will also be interested in ,
- ScriptAlias and Alias in httpd.conf at a glance
- mod_security the Apache Module, The Apache Firewall blocking your website?
- Disable the TRACE and TRACK For More Security
- How to install XAMPP
- Url rewriting examples using .htaccess
- Fix the problem in getting 500 Internal Server Error In Localhost Due To .htaccess
- mod_proxy_balancer apache load balancing
- How to run jsp in xampp?
- Apache AddHandler application/x-httpd-php not working?
- .htaccess some facts and rules
