irvincg
(Craig Irvin)
July 28, 2022, 3:13am
5
Wanted to add in that I found that the URI directive has a lower precedence than redir so this wasn’t working until I feed it through the route directive
http://subdomain.SorryHaveToRedact.org {
route {
uri strip_prefix /uw-mc
redir https://portal.newdomain.org{uri}
}
}
1. Caddy version (caddy version):
v2.4.6 h1:HGkGICFGvyrodcqOOclHKfvJC0qTU7vny/7FhYp9hNw=
2. How I run Caddy:
a. System environment:
macOS 12.1 | Apple Silicon
b. Command:
./caddy start
c. Service/unit/compose file:
N/A
d. My complete Caddyfile or JSON config:
http://localhost:8080 {
@catalog {
path */catalog/*
}
handle @catalog {
uri replace : ""
@token path_regexp token (^\/.+\/)(catalog\/.+)
#respond @token {re.token.2}
redir @token https://library.org/{re.t…
2 Likes