Skip to content

Improved `redirect` operator to support more url types

Compare
Choose a tag to compare
@am0s am0s released this 07 Jan 08:36
· 16 commits to master since this release

A new parameter type can be used to control how the resulting URL is generated.

It can contain one of

  • abs - Generates an absolute url, with path-prefix/siteaccess
  • root - Generates a relative url without path-prefix/siteaccess
  • absroot - Generates an absolute url, without path-prefix/siteaccess

Additionally improvements:

  • Url starting with double slashes, ie. url without a scheme are supported.
  • Improved https detection, now works if behind a proxy.

For instance to ensure that an absolute url is returned:

{redirect("/about", 302, "abs")}
{redirect("https://example.org", 302, "abs")}