server.go
func (ctx *RequestCtx) Redirect(uri string, statusCode int) {
	u := AcquireURI()
	ctx.URI().CopyTo(u)
	u.Update(uri)
	ctx.redirect(u.FullURI(), statusCode)
	ReleaseURI(u)
}
func (ctx *RequestCtx) Redirect(uri string, statusCode int) {
	u := AcquireURI()
	ctx.URI().CopyTo(u)
	u.Update(uri)
	ctx.redirect(u.FullURI(), statusCode)
	ReleaseURI(u)
}
func ( ctx * RequestCtx ) Redirect ( uri string , statusCode int ) { u := AcquireURI ( ) ctx . URI ( ) . CopyTo ( u ) u . Update ( uri ) ctx . redirect ( u . FullURI ( ) , statusCode ) ReleaseURI ( u ) }
// Redirect sets 'Location: uri' response header and sets the given statusCode.
//
// statusCode must have one of the following values:
//
//    * StatusMovedPermanently (301)
//    * StatusFound (302)
//    * StatusSeeOther (303)
//    * StatusTemporaryRedirect (307)
//    * StatusPermanentRedirect (308)
//
// All other statusCode values are replaced by StatusFound (302).
//
// The redirect uri may be either absolute or relative to the current
// request uri. Fasthttp will always send an absolute uri back to the client.
// To send a relative uri you can use the following code:
//
//   strLocation = []byte("Location") // Put this with your top level var () declarations.
//   ctx.Response.Header.SetCanonical(strLocation, "/relative?uri")
//   ctx.Response.SetStatusCode(fasthttp.StatusMovedPermanently)
//
Redirect sets Location : uri response header and sets the given statusCode . statusCode must have one of the following values : * StatusMovedPermanently ( 301 ) * StatusFound ( 302 ) * StatusSeeOther ( 303 ) * StatusTemporaryRedirect ( 307 ) * StatusPermanentRedirect ( 308 ) All other statusCode values are replaced by StatusFound ( 302 ) . The redirect uri may be either absolute or relative to the current request uri . Fasthttp will always send an absolute uri back to the client . To send a relative uri you can use the following code : strLocation = [] byte ( Location ) // Put this with your top level var () declarations . ctx . Response . Header . SetCanonical ( strLocation / relative?uri ) ctx . Response . SetStatusCode ( fasthttp . StatusMovedPermanently )