A caddy plugin to load a list of redirects from a file. It's very simple. And I've only hacked it together in a few hours. I'd not advise you to use it in production ...
Build caddy with xcaddy
:
xcaddy build --with github.com/bigwhoop/caddy-redir-file
mv caddy /usr/bin/caddy
{
order redir_file first
}
www.domain.com {
redir_file {
path "/path/to/redirects.csv"
type "csv"
csv_separator ";"
}
}
from;to
/from-here;/to-here
/and-here;/to-here
cd <repo>
xcaddy build --with github.com/bigwhoop/caddy-redir-file=./ --output caddy
./caddy run --config example/Caddyfile
Visit http://localhost:8090/from/here.
MIT