Custom error messages can be in the form of a mapping to a file or to a URL. Either of these can be implemented by using the Custom Errors property sheet in the IIS snap-in.
To customize an error message by mapping to a file
To customize an error message by mapping to a URL
Notes
403, 405, 410 - must be greater than 256 bytes
400, 404, 406, 408, 409, 500, 500.12, 500.13, 500.15, 501, 505 - must be greater than 512 bytes