http Redirect




    Go Code Snippets

    The code tells the web browser to take the request to the specified URL, but instead of rendering the page, to take the request to the Redirect resource instead. The Redirect resource is responsible for handling the status code and redirecting the browser to the appropriate page. The code uses the http.StatusFound status code to indicate that the requested page was found.

    Shortcut: rd

    http.Redirect(w, r, "/", http.StatusFound)
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Playground
    • Snippets
    • Cookbooks
    • Security
    • Privacy Policy
    • Code Privacy
    • Terms of Service
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.