You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Mario Ohnewald <MO...@aradex.com> on 2002/02/05 08:44:12 UTC

ErrorDocument - 404

Hello!
I am doing  a Redirection from (as an example)
/usr/local/httpd/htdocs/test/ --> http://www.geocities.com/myaccount/test/
This works perfectly!

My question is, if i can "force" MY ErrorDocument to come up, when the error
actually is on the geocities server (when it cant find a file there)
I would like to get my own ErorDocument when i go to:
/usr/local/httpd/htdocs/test/ (which the redirected folder on geocities)
I know that i can´t change the ErrorDocument of geocitoes ;).

Is there a way to "force" my ErrorDoc in this folder?
The only way i could think of is to write a script which checks if a file
exits there, and if not, apache sends me a local 404 error. But that is
pretty tricky.

The reason for this all is that i want to make a webserver, but actually
redirect almost every folder, cause i have simply not the speed to provide a
couple of 30MB Pages.

I hope i explained it well. If not, please let me know!

Thank you!
Mario Ohnewald



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: ErrorDocument - 404

Posted by Owen Boyle <ob...@bourse.ch>.
Mario Ohnewald wrote:
> 
> Hello!
> I am doing  a Redirection from (as an example)
> /usr/local/httpd/htdocs/test/ --> http://www.geocities.com/myaccount/test/
> This works perfectly!
> 
> My question is, if i can "force" MY ErrorDocument to come up, when the error
> actually is on the geocities server (when it cant find a file there)
> I would like to get my own ErorDocument when i go to:
> /usr/local/httpd/htdocs/test/ (which the redirected folder on geocities)
> I know that i can´t change the ErrorDocument of geocitoes ;).
> 
> Is there a way to "force" my ErrorDoc in this folder?
> The only way i could think of is to write a script which checks if a file
> exits there, and if not, apache sends me a local 404 error. But that is
> pretty tricky.

Think about it - when you define a Redirect, the process is as follows:

- client requests page from your server
- your server sends a "302 Moved Temporarily" response containing the
address of the remote server.
- your server has done its work and now forgets about the request.
- the client receives the 302 and requests the page from the remote
server
- the remote server handles the request and responds with the page or an
error

How do you expect your server to know what is going on between the
client and remote server?

The only way you could approach what you want is to forget about
redirecting and set up your server to act as a proxy - your server
actually fetches the page from the remote server on behalf of the
client. Then you could intercept 404s from the remote server. However,
you would then have to handle twice the bandwidth - all the data in,
tehn all the data out again...

Rgds,

Owen Boyle.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org