Bug 58180

Summary: ErrorDocument original URL in subsequent <Location>
Product: Apache httpd-2 Reporter: alexander <alexander>
Component: CoreAssignee: Apache HTTPD Bugs Mailing List <bugs>
Status: NEW ---    
Severity: enhancement    
Priority: P2    
Version: 2.4.10   
Target Milestone: ---   
Hardware: PC   
OS: Linux   

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"

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

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>.