caddy: Index | Files

package redirect

import ""

Package redirect is middleware for redirecting certain requests to other locations.


Package Files

redirect.go setup.go

type Redirect Uses

type Redirect struct {
    Next  httpserver.Handler
    Rules []Rule

Redirect is middleware to respond with HTTP redirects

func (Redirect) ServeHTTP Uses

func (rd Redirect) ServeHTTP(w http.ResponseWriter, r *http.Request) (int, error)

ServeHTTP implements the httpserver.Handler interface.

type Rule Uses

type Rule struct {
    FromScheme   func() string
    FromPath, To string
    Code         int
    Meta         bool

Rule describes an HTTP redirect rule.

Package redirect imports 5 packages (graph) and is imported by 109 packages. Updated 2019-07-03. Refresh now. Tools for package owners.