For technical reasons we need to perform an HTTP 307 redirect instead of a 302.
For 302's I'd do:
HttpContext.Current.Response.Redirect(url)
For 301's I do:
HttpContext.Current.Response.RedirectPermanent(url)
How would I implement a 307?
Solved this by adding a location header and doing redirect manually:
HttpContext.Current.Response.StatusCode = 307;
HttpContext.Current.Response.StatusDescription = "Temporary Redirect";
HttpContext.Current.Response.AddHeader("Location", redirectURL);
HttpContext.Current.Response.End();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With