Hi all,
I've written a custom error routine for 404 errors that can result in a valid page. The page basically checks the requested URI and in some cases this will give it a valid page to display. I include this page but the requested path is carried through to the included page. This causes relative image paths to be invalid.
e.g.
requesting
[url]http://www.mysite.com/fake/page.htm[/url]
gives
include("http://www.mysite.com/fake.htm");
however the document thinks it is:-
http://www.mysite.com/fake/fake.htm
and image references end up as
http://www.mysite.com/fake/images/picture.png
instead of
http://www.mysite.com/images/picture.png
I've worked around this by sending location headers rather than using includes but I'd prefer to stick to my original plan if someone knows how to get around this.
The second part of this problem is lack of knowledge about Apache so might not be relevant here. What I want to do is prevent the 404 error from being logged if the 404 PHP script gives a valid page to include. I'm not sure if Apache has already logged the error by the time the script runs, if it hasn't, is there a way to block this logging on a per request basis within the 404 error PHP page?
Thanks for any help..