NAME

PAGI::App::Redirect - URL redirect app

SYNOPSIS

use PAGI::App::Redirect;

my $app = PAGI::App::Redirect->new(
    to => '/new-location',
    status => 301,
)->to_app;

DESCRIPTION

Performs HTTP redirects. The target can be a static URL or a callback.

OPTIONS

  • to - Target URL (string or coderef receiving $scope)

  • status - HTTP status code (default: 302)

  • preserve_query - Append query string to target (default: 1)