How do I setup Apache to return a 204 code?

前端 未结 1 2089
Happy的楠姐
Happy的楠姐 2021-02-20 05:04

How do I setup Apache to return a 204(no-content) instead of a 404 code for a certain URL?

1条回答
  •  花落未央
    2021-02-20 05:38

    Putting together the Redirect documentation with the RedirectMatch documentation, we see that yes, we can send a custom 204 back. Here is a quick example that responds with 204 to any request matching foo with any characters after it.

     #RedirectMatch example using mod_alias 
     RedirectMatch 204 foo(.*)$
    

    from here http://www.lowlevelmanager.com/2009/07/returning-apache-204.html

    0 讨论(0)
提交回复
热议问题