Added option to redirect with different status code.