Redirect

Redirects to the URL derived from the specified path, with specified status, a positive integer that corresponds to an HTTP status code.

If not specified, status defaults to 302 Found.
  1. c.Redirect(path string, status ...int)
  1. app.Get("/", func(c *fiber.Ctx) {
  2. c.Redirect("/foo/bar")
  3. c.Redirect("../login")
  4. c.Redirect("http://example.com")
  5. c.Redirect("http://example.com", 301)
  6. })