(FYI I would have submitted a PR for this but I couldn't find the redirects page in kagi-docs)
Redirects will get its own page there eventually, but the examples on https://kagi.com/settings?p=redirects_form won't be sourced from there.
Any "in-app" text that you see will eventually be open source as part of our upcoming localization efforts.
2) It might be nice to mention if you need to provide a $1 variable for the remainder of the URL.
That's not exactly how it works - the $N
refer to capture groups in the regex - patterns surrounded in ()
. If you want to preserve the remainder of the URL, then you need to put it in a capture group to refer to it in the rewrite.
For example:
(https://foo.com)/bar/(.*)
$1 $2
$1
will refer to https://foo.com
$2
will refer to anything & everything that follows bar/
So, if your replacement expression is $1/baz/$2
, it will be substituted accordingly with those parts.
You can have an arbitrary number of these in your matching pattern.
N.B. There is an exception where this is not needed:
If your rule is very simple like ^https://www.reddit.com|https://old.reddit.com
- which only alters the domain - we will implicitly maintain whatever path was on the URL for you, so you don't have to write something more complex to do so.