Question

I want to set the HTTP return code through a .htacces directive. So I was wondering if this is possible, as mod_headers states it expects: Name "Value".

If not what would be a good way to send a "HTTP/1.1 451 Redirect" using only .htaccess?

I want to redirect an ActiveSync on a host without server side scripting. So I only have .htaccess and static files.

Thanks!

Was it helpful?

Solution 2

Well which action makes the most sense? You want to send a status header, and two of them or appending to an existing one would not make sense, so you want to use set.

And the value is 451 of course. You can put any text behind that if you want to, but status code textual descriptions in HTTP are pure “sugar” for human readability, and any client has to ignore anything else but the numeric code.

OTHER TIPS

Once I needed to set the HTTP response status code just like that for whole domain in .htaccess file:

RewriteRule ^ - [R=410,L]

So this way it works now for me on Apache 2.4

RewriteRule can use non-3xx codes in the [R=xxx] flag. It should come pretty close.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top