This is a discussion on Re: Error Page URL question within the Apache Web Server forums, part of the Web Server and Related Forums category; On May 23, 4:57 am, shimmyshack <matt.fa...@gmail.com> wrote: > On May 22, 10:40 ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
On May 23, 4:57 am, shimmyshack <matt.fa...@gmail.com> wrote:
> 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 > >errorpageshows up with theURLfor theerrorpage(rather than for > > thepagethat was being navigated to, initially) in the address bar. > > > Seehttp://www.cs.tut.fi/~jkorpela/www/404.htmlforbackground on this > > tweak. > > > I'm curious if anybody has ideas about how I can get theerrorpageto > > show up, but with the requestedurlin the address bar, and in the > >errorpageitself. > > 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. |