Apache Server configuration support - Error Page URL question

This is Interesting: Free IT Magazines  
Home > Archive > Apache Server configuration support > May 2007 > Error Page URL question





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Error Page URL question
ajkurth@gmail.com

2007-05-22, 7:29 pm

We're trying to develop a CONF file that includes a rewrite statement
that converts Web URLs to local hard drive URLs (already written and
functioning) but that will allow for the use of relative URLs for
search engine and ErrorDocuments.

In my current set up, with the rewrite in place I can only use
absolute URLs to point to the ErrorDocuments. However, this causes the
client to receive a wrong (great success!) return code, i.e., the the
error page shows up with the URL for the error page (rather than for
the page that was being navigated to, initially) in the address bar.

See http://www.cs.tut.fi/~jkorpela/www/404.html for background on this
tweak.

I'm curious if anybody has ideas about how I can get the error page to
show up, but with the requested url in the address bar, and in the
error page itself.

shimmyshack

2007-05-23, 7:18 am

On May 22, 10:40 pm, ajku...@gmail.com wrote:
> We're trying to develop a CONF file that includes a rewrite statement
> that converts Web URLs to local hard drive URLs (already written and
> functioning) but that will allow for the use of relative URLs for
> search engine and ErrorDocuments.
>
> In my current set up, with the rewrite in place I can only use
> absolute URLs to point to the ErrorDocuments. However, this causes the
> client to receive a wrong (great success!) return code, i.e., the the
> error page shows up with the URL for the error page (rather than for
> the page that was being navigated to, initially) in the address bar.
>
> Seehttp://www.cs.tut.fi/~jkorpela/www/404.htmlfor background on this
> tweak.
>
> I'm curious if anybody has ideas about how I can get the error page to
> show up, but with the requested url in the address bar, and in the
> error page itself.


are you using an .htaccess file - I never had much luck with relative
paths inside htaccess files on some shared hosts, if you can use the
httpd conf then do so, this will allow you to use

ErrorDocument 404 "/custom/404.htm"

this type
ErrorDocument 402 http://www.example.com/subscription_info.html
as you say causes a redirect [302] instead of 404, which is why the
url changes, not what you want. If you have php (and probably perl)
installed, you can find the page on which the error originally
ocurred, and use it in the page. In that case you would probably use

ErrorDocument 404 "/custom/404.pl"
or
ErrorDocument 404 "/custom/error.php?code=404"
with <?php echo $_SERVER['REDIRECT_ERROR_NOTES']; ?>

ajkurth@gmail.com

2007-05-23, 1:21 pm

On May 23, 4:57 am, shimmyshack <matt.fa...@gmail.com> wrote:
> On May 22, 10:40 pm, ajku...@gmail.com wrote:
>
>
>
>
>
>
>
> are you using an .htaccess file - I never had much luck with relative
> paths inside htaccess files on some shared hosts, if you can use the
> httpd conf then do so, this will allow you to use
>
> ErrorDocument 404 "/custom/404.htm"
>
> this type
> ErrorDocument 402http://www.example.com/subscription_info.html
> as you say causes a redirect [302] instead of 404, which is why theurlchanges, not what you want. If you have php (and probably perl)
> installed, you can find thepageon which theerrororiginally
> ocurred, and use it in thepage. In that case you would probably use
>
> ErrorDocument 404 "/custom/404.pl"
> or
> ErrorDocument 404 "/custom/error.php?code=404"
> with <?php echo $_SERVER['REDIRECT_ERROR_NOTES']; ?>


The problem with employing php or something similar is that we're not
working with a full-blown server for this implementation. Rather, we
have - essentially - an external hard drive that installs an apache
webserver on the host machine as soon as it is plugged in, employing
apache and tomcat to serve the contents of the drive, with tomcat
working with luceneizer indexes to power a search engine for the
content. Thus, we cannot employ PERL or php solutions, so I'm hoping
to find a solution at the apache configuration level.

ajkurth@gmail.com

2007-05-23, 1:21 pm

On May 23, 4:57 am, shimmyshack <matt.fa...@gmail.com> wrote:
> On May 22, 10:40 pm, ajku...@gmail.com wrote:
>
>
>
>
>
>
>
> are you using an .htaccess file - I never had much luck with relative
> paths inside htaccess files on some shared hosts, if you can use the
> httpd conf then do so, this will allow you to use
>
> ErrorDocument 404 "/custom/404.htm"
>
> this type
> ErrorDocument 402http://www.example.com/subscription_info.html
> as you say causes a redirect [302] instead of 404, which is why theurlchanges, not what you want. If you have php (and probably perl)
> installed, you can find thepageon which theerrororiginally
> ocurred, and use it in thepage. In that case you would probably use
>
> ErrorDocument 404 "/custom/404.pl"
> or
> ErrorDocument 404 "/custom/error.php?code=404"
> with <?php echo $_SERVER['REDIRECT_ERROR_NOTES']; ?>


The problem with employing php or something similar is that we're not
working with a full-blown server for this implementation. Rather, we
have - essentially - an external hard drive that installs an apache
webserver on the host machine as soon as it is plugged in, employing
apache and tomcat to serve the contents of the drive, with tomcat
working with luceneizer indexes to power a search engine for the
content. Thus, we cannot employ PERL or php solutions, so I'm hoping
to find a solution at the apache configuration level.

ajkurth@gmail.com

2007-05-23, 1:21 pm

On May 23, 4:57 am, shimmyshack <matt.fa...@gmail.com> wrote:
> On May 22, 10:40 pm, ajku...@gmail.com wrote:
>
>
>
>
>
>
>
> are you using an .htaccess file - I never had much luck with relative
> paths inside htaccess files on some shared hosts, if you can use the
> httpd conf then do so, this will allow you to use
>
> ErrorDocument 404 "/custom/404.htm"
>
> this type
> ErrorDocument 402http://www.example.com/subscription_info.html
> as you say causes a redirect [302] instead of 404, which is why theurlchanges, not what you want. If you have php (and probably perl)
> installed, you can find thepageon which theerrororiginally
> ocurred, and use it in thepage. In that case you would probably use
>
> ErrorDocument 404 "/custom/404.pl"
> or
> ErrorDocument 404 "/custom/error.php?code=404"
> with <?php echo $_SERVER['REDIRECT_ERROR_NOTES']; ?>


The problem with employing php or something similar is that we're not
working with a full-blown server for this implementation. Rather, we
have - essentially - an external hard drive that installs an apache
webserver on the host machine as soon as it is plugged in, employing
apache and tomcat to serve the contents of the drive, with tomcat
working with luceneizer indexes to power a search engine for the
content. Thus, we cannot employ PERL or php solutions, so I'm hoping
to find a solution at the apache configuration level.

ajkurth@gmail.com

2007-05-23, 1:21 pm

On May 23, 4:57 am, shimmyshack <matt.fa...@gmail.com> wrote:
> On May 22, 10:40 pm, ajku...@gmail.com wrote:
>
>
>
>
>
>
>
>
>
> are you using an .htaccess file - I never had much luck with relative
> paths inside htaccess files on some shared hosts, if you can use the
> httpd conf then do so, this will allow you to use
>
> ErrorDocument 404 "/custom/404.htm"
>
> this type
> ErrorDocument 402http://www.example.com/subscription_info.html
> as you say causes a redirect [302] instead of 404, which is why theurlchanges, not what you want. If you have php (and probably perl)
> installed, you can find thepageon which theerrororiginally
> ocurred, and use it in thepage. In that case you would probably use
>
> ErrorDocument 404 "/custom/404.pl"
> or
> ErrorDocument 404 "/custom/error.php?code=404"
> with <?php echo $_SERVER['REDIRECT_ERROR_NOTES']; ?>- Hide quoted text -
>
> - Show quoted text -


The problem with employing php or something similar is that we're not
working with a full-blown server for this implementation. Rather, we
have - essentially - an external hard drive that installs an apache
webserver on the host machine as soon as it is plugged in, employing
apache and tomcat to serve the contents of the drive, with tomcat
working with luceneizer indexes to power a search engine for the
content. Thus, we cannot employ PERL or php solutions, so I'm hoping
to find a solution at the apache configuration level.

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2009 webservertalk.com