Configure > Redirect Directives
This document describes the configuration directives of the redirect handler.
- Description:
-
Redirects the requests to given URL.
The directive rewrites the URL by replacing the host and path part of the URL at which the directive is used with the given URL. For example, when using the configuration below, requests to
http://example.com/abc.html
will be redirected tohttps://example.com/abc.html
.If the argument is a scalar, the value is considered as the URL to where the requests should be redirected.
Following properties are recognized if the argument is a mapping.
url
- URL to redirect to
status
- the three-digit status code to use (e.g.
301
) internal
- either
YES
orNO
(default); if set toYES
, then the server performs an internal redirect and return the content at the redirected URL
hosts: "example.com:80": paths: "/": redirect: status: 301 url: "https://example.com/" "/rss": file.dir: /path/to/rss
- Level:
- path