Home
Application
Web Application
How to create custom Error Pages?
Application
Web Application
How to create custom Error Pages? Google Translation
Main Menu
| Home |
| Useful Links |
| Public Route Server |
| Download |
| Contact Us |
Advertisements
Who's Online
Latest Articles
- Network performance testing with Iperf
- How to disable anonymous account on pure-ftp server
- How to install and maintain PostgreSQL with phpPgAdmin
- How to transfer Putty.exe's setting to other computers
- Preventing Security Attacks from all OSI 7 Layer
- How to locate a IP address using WHOIS
- Wake on LAN extention for SSL explorer
- How to obtain Ethernet addresses
Popular
- Enable Telnet on IE7.0 with Windows XP and Vista
- Cisco 7200 Simulator - Dynamips installation for window
- How to create loopback interface on Windows XP
- How IP-helper address works?
- Network Settings In VMWare Player
- BGP sample configuration guide - Cisco
- BGP sample configuration Case 1-1
- BGP Community String for Verizon Business AS701
| How to create custom Error Pages? |
|
|
|
| Written by Chris | |||||
|
Error pages come in a variety of forms, but can be customized. Those error documents are web pages designed to give a polite explanation for error conditions. These error conditions generate numbers which are used to refer to the appropriate error condition. Some of the most common messages are as follows: Error in Client
400 Bad syntax 403 Forbidden 404 Not Found - Most common Error in Server
500 Internal Error You can customize error pages in three ways By creating a ".htaccess" file: 1. First, create the HTML page you want to use as your error message and upload it to your home directory. 2) Next, create a .htaccess file (using NotePad or similar) and add lines which specify the substitution. Here are three examples of specifying error documents which will be called for a given error condition (note you can use relative or absolute addressing): ErrorDocument 400 http://www.your_domain.com/400.html
ErrorDocument 403 http://www.your_domain.com/403.html ErrorDocument 404 http://www.your_domain.com/404.html ErrorDocument 500 http://www.your_domain.com/500.html Just add these lines to your .htaccess file. 3. Next upload the .htaccess file into your home directory. You will not see it once uploaded since it gets hidden by the server. 4. Test it out. Go to http://www.your_domain.com/anything_you_want.html Using a .htaccess file does not work for PHP files. If you want these errors to work for PHP files too, then use the process below. By creating error files
You can simply create error pages and name them as follows: error400.html
error403.html error404.html error500.html Please place these files in the home directory of your domain. By adding this piece of code in the .htaccess file
RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule (.*) /errordocument.html Create a file named "errordocument.html" containing your error message content. Add as favourites (33) | Views: 295 | E-mail
Only registered users can write comments. Powered by AkoComment Tweaked Special Edition v.1.4.3 |
|||||




Be first to comment this article





















