Forwarding: Redirect

Lifeboat allows developers to configure redirects to other URLs. Developers may select the exact status code they wish to respond with from the configuration view.

To configure a forward as a redirect, from the "Type:" popup menu select "Redirect".

Select a domain and optionally enter a path. It is possible to configure a redirect at the root path, and a static files website as a subfolder. To do so, be sure the "Also redirect anything after this path" option is disabled.

Enter a Target URL to redirect to and select the HTTP Status code to respond with. The user friendly names are also displayed with the codes. Code 301 is friendly for SEO and should be used in most cases. Code 302 is more appropriate if the target URL is likely to change.

The other codes are included for completeness, but aren't widely used. These codes can affect how browsers cache and optimize. For reference: Mozilla HTTP status codes documentation

Click the Save button to save and update the remote nginx configuration.

Wildcard Redirects

The option "Also redirect anything after this path" will redirect any request that begins with: [domain]/[web path]

A trailing slash on the web path is optional, and it is possible to wildcard match a "file". In effect, it is possible to match and redirect a request for https://strawberrysw.com/lifeboat/index.htmlwildcardtest

To preserve the remainder of the URL (what nginx matched with the wildcard), select the secondary checkbox that appears when wildcard redirecting is enabled. This will optionally match a slash ("/") but the slash will not be passed to the Target URL. Be sure to include a trailing slash or question mark on the Target URL if it will be necessary.

The list view will display an asterisk (*) after the address to indicate that the Wildcard Redirect feature is enabled. Similarly, the list view will display $1 (a common RegEx expression to mean the first capture value) to indicate that captured wildcards are being appended to the target URL. These indicators can also help illustrate what to expect from the redirect.