I want to define a .htaccess rewrite condition that allows me to define a rewrite rule depending on HTTP status code. With PHP there is no problem, but in .htaccess I found no solution in any Apache documentation.
CodePudding user response:
It's about status codes 30x, 4x and 50x and if they are set by any application.
That's simply not possible with .htaccess
.
By the time the application is sending back the response, mod_rewrite (RewriteRule
/ "rewrite condition") has long since finished processing the request.
You can only check the HTTP request, not the response with mod_rewrite.