Trigger Redirects In PWA Kit

To redirect whole pages or assets, use the Redirect functionality provided by Runtime Admin or the Managed Runtime API. See Redirects.

The Progressive Web App (PWA) Kit uses React Router redirects. However, the React Router Redirect component does not let you set a status code.

In PWA Kit 3.9, we added a RedirectWithStatus component that builds on top of the React Router Redirect component and allows you to create redirects with a status code.

The example below shows how you would add a redirect with an HTTP 301 status from an example page to the login page in your PWA Kit project.