Use 301 for release redirection
Proper HTTP status for release

Rearrange code to allow header() to work