module Redirection

A middleware which assists with redirecting from one path to another.

Classes and Modules

class ClientRedirect < Protocol::HTTP::Middleware

A basic client-side redirect.

class DirectoryIndex < ClientRedirect

Redirect urls that end with a /, e.g. directories.

class Errors < Protocol::HTTP::Middleware

A middleware which performs internal redirects based on error status codes.

class Moved < ClientRedirect

Rewrite requests that match the given pattern to a new prefix.

class RequestFailure < StandardError

An error handler fails to redirect to a valid page.

class Rewrite < ClientRedirect

Rewrite requests that match the given pattern to a single destination.

Definitions

MAX_AGE = 3600*24

We cache 301 redirects for 24 hours.