0

I have a load of services all using the same block of code and all incorrectly returning a 406 (Not acceptable) when what was really wanted was a 410 (Gone). The difference is not simply one of correctness, but has other implications upstream as 410s can be cached and 406s can't.

In the long run all the underlying code is going to have to be altered and retested and it'll take time and money.

In the meanwhile it would be cool if I could simply alter all 406 responses to become a 410 as they pass through the Apache 2.2 front end.

Does anyone have a quick win for me here?

Thanks in advance.

James A Mohler
  • 11,060
  • 15
  • 46
  • 72
Col Wilson
  • 889
  • 10
  • 16

1 Answers1

0

This feels like a horrible hack but you could configure an error document for all 406 responses that itself sends a 410 status code:

ErrorDocument 406 http://yoursite.com/script-that-sends-410-status-code
Ian Oxley
  • 10,916
  • 6
  • 42
  • 49
  • I wonder, if `Redirect 406 /e/410` would also work, thus sparing some script to yield the HTTP 410. If I'd had an apache at hand would try it out ... – Dilettant Jul 29 '11 at 13:43
  • I'm not skilled in this, doesn't that just tell the client that script-that-sends-410-status-code has Gone? I mean won't the browser/client see the redirect? – Col Wilson Jul 29 '11 at 13:44