开发者

Can I get Apache to alter Response Status Codes?

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.


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
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜