For each request, the plugin removes the scheme and domain components, and appends the rest of the URL with the contents of
redirectTo configuration variable. This allows for seamless redirection of all requests for URLs in the original domain to a new location, in case the original domain is expected to be permanently unavailable.
This plugin is, in a way, the last line of defense, and can be configured but not enabled (by setting the
enabled configuration flag to
false). In case of a permanent problem with the original domain visitors with the Service Worker installed and running can receive a config update via alternative transports that enables this plugin, which in turn redirects them to the new domain of the website.
redirect plugin supports the following configuration options:
A string containing the base URL for all redirectons; should end in “
redirectStatusText (default: “
These two config variables define the HTTP status code and message to be used for the redirect.
falsethe plugin is disabled, but still loaded into the service worker.