Load my own "page not found" instead of IE-browser default one?

liunx

Guest
Hi,<br />
I'd like to load my own default page when the page is not found instead of IE-browser "page not found...". Any way?<br />
<br />
more info: Following tag will load "realpage.jsp". Or shows "Page not found...", if page is not available. <br />
<A target="_blank" HREF=http://www.htmlforums.com/archive/index.php/"realpage.jsp" >Real page</A> <br />
Now, i am looking for a way to load my own default page instead of default "Page not found...", when the "realpage.jsp" is not available. <br />
<br />
Thanks.<!--content-->put this in a blank file and save it as ".htaccess" (use the quotes - otherwise, most text editors may not be eble to save it as .htaccess)<br />
<br />
ErrorDocument 404 /path/to/404.html<br />
<br />
upload it to your root (or to a directory if you only want that error page valid for a certain directory).<!--content-->transmothra,<br />
<br />
Following your answer, i created a file including: <br />
<br />
ErrorDocument 404 /path/to/404.html<br />
<br />
and named it i.htaccess and locate it in the same directory <br />
as "realpage.jsp" , but still received IE-browser default page not found... <br />
<br />
Any thing i missed?<!--content-->Originally posted by chadorbaf <br />
transmothra,<br />
<br />
Following your answer, i created a file including: <br />
<br />
ErrorDocument 404 /path/to/404.html<br />
<br />
and named it i.htaccess and locate it in the same directory <br />
as "realpage.jsp" , but still received IE-browser default page not found... <br />
<br />
Any thing i missed? <br />
yes you did. it is not i.htaccess but just .htaccess<br />
<br />
nothing before it, htaccess is the extension<!--content-->Ok,<br />
<br />
Created a file named ".htaccess" icluding :<br />
ErrorDocument 404 /images/404.html<br />
<br />
Created another html file named "404.html" which shows my custom error message text.<br />
<br />
And locate both of the above files in a directory named "images" which is a subdirectory of default web site <br />
directory and where "realpage.jsp" is located.<br />
<br />
But still doesn't work.<br />
Please let me know what else i missed?<!--content-->put the htaccess file in the root folder. above images I guess since I don't know your foldert structure.<br />
<br />
and also your host has to let you run them.<!--content-->right, i shoulda mentioned that. i have a host i work with that won't let us do our own .htaccess files. set your file mask to show absolutely all files and see if the file is even still there. it sounds like it's not working because it's not supposed to on yr host.<br />
<br />
.htaccess files SHOULD work in any folder, and should affect all folders underneath it.<br />
<br />
another thing to check is if your host is running Apache or something else. if they're running Windows or something, it won't work... i dunno how you do custom error pages on Windows machines.<!--content-->Originally posted by transmothra <br />
<br />
<br />
.htaccess files SHOULD work in any folder, and should affect all folders underneath it. <br />
it should too, but I was just ruling out all possiblities. :)<!--content-->
 
Back
Top