GeekPride
GeekPride

Reputation: 207

forward Request parameters to custom 404 page using ErrorDocument in apache?

Is there a way to have the request parameters "forward on" to the custom error file in apache much like [QSA] does on rewrite rules?

if i send in www.foo.com/doesnotexist?bar=true

and i have this in vhost:

ErrorDocument 404 /customerrorpage

then it would call customerrorpage with:

customerrorpage?bar=true

Upvotes: 0

Views: 1669

Answers (1)

Richard
Richard

Reputation: 228

I know this is really old question, but it hasn't been answered and so in case someone else is searching the site for the answer I'll share what I know.

The Apache 2.2 ErrorDocument page says that when you have a Custom Error page which is a local page then a number of environment vars will be set which can be read from your customer error handler. One of the vars is REDIRECT_QUERY_STRING which will contain the query string that the original page had. So in your example the REDIRECT_QUERY_STRING would contain 'bar=true'.

Upvotes: 2

Related Questions