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.
- c.Redirect(path string, status ...int)
- app.Get("/", func(c *fiber.Ctx) {
- c.Redirect("/foo/bar")
- c.Redirect("../login")
- c.Redirect("http://example.com")
- c.Redirect("http://example.com", 301)
- })