Hi all
Thanks for the tips. I got it working now at last. I had the
htaccess rpm
installed, but could not get it to work, but eventually last
night and
tweaking this morning it's working.
What I did for anyone who wants to know (as there were gaps
in the advise
which I found here in the forums)
Ran the htaccess rpm as discussed in a previous message in
this thread.
Don't change anything in the apache conf (httpd.conf) (I
tried that as well
, but you shouldn't)
Place an .htaccess file in the root where you need to
capture all lost
files.
ie.
.../ibays/domain/html/.htaccess will capture all lost
files in sub sequent
directories.
.../ibays/domain/html/photos/.htaccess will only capture
lost files in
/photos/ and subsequent directories.
My .htaccess file lokked like this:
ErrorDocument 404 /err404.html^
Where:
ErrorDocument telling Apache what to do, what to look for.
404 the type of error (You can add more error codes like
Roger said)
/err404.html is a flat HTML file, but could be like the file
Roger mentioned
with PHP code. This file is in the root of this ibay.
(I had my files all over the place and tried all the
combinations- like
primary, etc/httpd, etc)
/ means root of THIS Virtual Domain and NOT primary.
What I had in my err404.html is a short notice which says
page is missing,
please click on link if javascript doesn't take you back and
then the
Javascript or link will take you to the root which is
default.php in my
case.
This works for images as well. If you call a image.jpg
direct in the browser
and the images doesn't exist, then it will show this page.
.htaccess can be made rather complicated with all kinds of
tricks like
preventing deep level linking.
REMEMBER to clear the cache . I battle for hours just
because I didn't clear
the cache of my browser. It might help to clear the squid
proxy cache as
well, I'm not sure.
regards
Paul