Bug 58180 - ErrorDocument original URL in subsequent <Location>
Summary: ErrorDocument original URL in subsequent <Location>
Status: NEW
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: Core (show other bugs)
Version: 2.4.10
Hardware: PC Linux
: P2 enhancement (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-07-24 20:53 UTC by alexander
Modified: 2015-07-24 20:53 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description alexander 2015-07-24 20:53:00 UTC
I am trying to use the following configuration:

<LocationMatch "(.*\.(html|htm))$">
  ErrorDocument 404 "/error-404.html"
</LocationMatch>

<Location "/error-404.html">
  RequestHeader set customheader "%{ENV:REDIRECT_URL}e"
  ProxyPass "http://otherhost.org/"
  ProxyPassReverse "http://otherhost.org/"
</Location>

So ErrorDocument internally redirects to error-404.html, and in so doing sets a header REDIRECT_URL = original URL. I then want to proxy the reques to otherhost.org, setting the original URL as a request header. Everything works, except for that REDIRECT_URL apparently is not yet available when the <Location> directives are executed, because 'customheader' above always gets set to just '{null}'.

So my feature enhancement suggestion is that REDIRECT_URL be made available somehow in the <Location>.