0

So let's say I have a 403 page but if the request header has a custom value in it - I want to return a different 403 with a bit more information in.

So the normal 403 location may be /error_403 and the custom one may be /error_403_x.

How would you handle this in apache?

1 Answers1

0

Assuming that you're using Apache 2.4.x

Using the If/Else parameters, it is simple to implement:

<If "%{HTTP:X-MyRequestHeader} == myvalue">
ErrorDocument 403 /error403_x.html
</If>
<Else>
ErrorDocument 403 /error403.html
</Else>

In this example it will return a different file based on the "X-MyRequestHeader: myvalue" Header.

João Alves
  • 511
  • 2
  • 6