custom site error pages

  • Thread starter Thread starter -Anat-
  • Start date Start date
  • Replies Replies 1
  • Views Views 4,742


first create HTML pages that u want for1) error 404 - page not found.2) error 401 - authorization reqd.3) error 403 - access forbidden.make a new subdirectory on the server to hold there arror pages, lets call it "customerror" and lets name the error pages created above as "error404.html" , "error401.html" and "error403.html" {without the quotes}create a new text file and put in the following info:ErrorDocument 401 /customerror/error401.htmlErrorDocument 403 /customerror/error403.htmlErrorDocument 404 /customerror/error404.htmlupload this file onto the server and rename it ".htaccess" {sans the quotes, obviously}, this name is not allowed in windows, so u can only rename it to ".htaccess" {sans the quotes} once the file is up on the server. More info:if u include an image or embed an object in the error pages, u cannot give the relative URL of the object {eg: "../mypic.jpg" or "mypic.jpg"}, u have to give the full path {eg ""}Suggestons:u cud also have the 404 page be redirected to the sitemap of ur site with the suggestion to the user "page not found, select reqd section" or u cud have a feedback form on the 404 error page asking the user for the address of the current page and referring page so that u could point out the place where u placed a wrong hyperlink URL.
heh, notepad wont let you save with .htaccess file name but atleast XP let you have files with this name 🙂 my text editor happily work with .hta files on my system.

and also important is that most FTP clients wont show you uploaded .htaccess file so please careful if you uploaded a totally new one. because in my experience you do not get a confirmation overwrite box for hidden files.

a good guide can be found here... 🙂