caddy: github.com/mholt/caddy/caddyhttp/redirect Index | Files

package redirect

import "github.com/mholt/caddy/caddyhttp/redirect"

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

Index

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
    httpserver.RequestMatcher
}

Rule describes an HTTP redirect rule.

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