1. The problem I’m having:
Is there a way to have the browser show a uri
replaced URL?
I have the url a.com/x/c
and I want it always to be redirected to a.com/y/c
(i.e. changing only /x
to /y
and leaving everything else intact.
The current Caddyfile works to change /x
to /y
:
a.com {
uri replace /x /y
}
This works to show the correct page. However, when I do this and go to a.com/x/...
seems that the browser URL still shows a.com/x/...
when I go to that page (even though it correctly shows the page at a.com/y/...
).
I guess there might be a combination of uri
and redirect
? I’m not sure how to use redirect
with a uri
replacement.
2. Error messages and/or full log output:
No error messages, because I can’t figure out the Caddyfile.
3. Caddy version:
v2.6.2 h1:wKoFIxpmOJLGl3QXoo6PNbYvGW4xLEgo32GPBEjWL8o=
4. How I installed and ran Caddy:
Using apt
.
a. System environment:
Ubuntu 22