For my error documents, I am using a single error page (error.html), which I redirect to using
ErrorDocument xxx http://www.example.com/error.html?error=xxx
This works fine, and I do the same for each of the 4xx and 5xx error codes, with the 'error=xxx' query string actually defining how the page looks (in terms of what text to display for what error was encountered).
I also need to capture the URL that was entered before the ErrorDocument redirect takes place, and append this to the ErrorDocument location as another query string
ErrorDocument xxx http://www.example.com/error.html?error=xxx**&url=yyy**
Am I able to do this? I know I read somewhere that it was possible with PHP, but I am avoiding PHP for this site (and it actually didn't work as expected when I did try).
I have looked at similar questions, but could not find one with that aided me.