Click to See Complete Forum and Search --> : [RESOLVED] 404 error pages for different directories


shane.carr
07-03-2006, 04:08 AM
How would I create a different 404 error page for a certain directory if there is a main one already set?

i.e:

.htaccess :

ErrorDocument 404 /404.html

It works fine, but how would I make a different one for say the directory foo?


EDIT:

The main 404 error page would remain for ALL OTHER DIRECTORIES except foo. For example, http://www.example.com/ahjdslfdhajskl would show the main 404 error page as well as http://www.example.com/bar/hkdfjsaafkdhj. HOWEVER, http://www.example.com/foo/jhkdsafhjkhjkdfsa would show a different error page.

Kevey
07-03-2006, 04:19 AM
Put an .htaccess file into the foo directory and reference the different 404 file in the foo directory, or reference the directory it is in.

ErrorDocument 404 /foo/404.html

shane.carr
07-03-2006, 06:22 PM
Thanks! I kind-of tried that, but I didn't know that you had to put /foo/404.html; I thought it was just /404.html (relative). Thanks! :)

Kevey
07-03-2006, 11:01 PM
No problem. :)